jkcldr opened a new issue, #9123:
URL: https://github.com/apache/iceberg/issues/9123
### Feature Request / Improvement
The 'history.expire.max-snapshot-age-ms' option doesn't have any effect
while expiring snapshots.
1)
CREATE TABLE IF NOT EXISTS test5d78b6 (
id INT, random1 STRING
)
PARTITIONED BY (random2 STRING)
STORED BY ICEBERG
TBLPROPERTIES (
'write.format.default'='orc',
'format-version'='2',
'write.orc.compression-codec'='none'
)
2) INSERT INTO test5d78b6 SELECT if(isnull(MAX(id)) ,0 , MAX(id) ) +1,
uuid(), uuid() FROM test5d78b6
3) INSERT INTO test5d78b6 SELECT if(isnull(MAX(id)) ,0 , MAX(id) ) +1,
uuid(), uuid() FROM test5d78b6
4) SLEEP for 30 seconds
5) INSERT INTO test5d78b6 SELECT if(isnull(MAX(id)) ,0 , MAX(id) ) +1,
uuid(), uuid() FROM test5d78b6
6) INSERT INTO test5d78b6 SELECT if(isnull(MAX(id)) ,0 , MAX(id) ) +1,
uuid(), uuid() FROM test5d78b6
7) SELECT (UNIX_TIMESTAMP(CURRENT_TIMESTAMP) - UNIX_TIMESTAMP('2023-10-09
13:23:54.455')) * 1000;
8) ALTER TABLE test5d78b6 SET
tblproperties('history.expire.max-snapshot-age-ms'='54000'); – the elapsed time
in ms from the second insert and current time
9) ALTER TABLE test5d78b6 EXECUTE expire_snapshots('2200-10-10');
10) SELECT COUNT FROM default.test5d78b6.snapshots;
output: 1. it should be 2 rows. The default 1 is retained an all snapshots
are expired as usual, so setting the property has no effect.
Additional Info: the default value for 'history.expire.max-snapshot-age-ms'
is 5 days per this link: https://iceberg.apache.org/docs/1.3.1/configuration/
Now while writing the tests and running them, the expiring snapshots just
worked fine within few seconds of the snapshots being created.
So, I'm assuming that this option doesn't have any effect right now. Having
said that, I'm thinking the implications on end user will have if we fix this.
The end user may not know about this option at all and will have tough time
figuring out why the snapshots are not getting expired. One option could be to
set the default to 0ms.
### Query engine
Hive
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]