ayushtkn commented on code in PR #4906:
URL: https://github.com/apache/hive/pull/4906#discussion_r1408729501
##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergExpireSnapshots.java:
##########
@@ -117,6 +118,34 @@ public void testExpireSnapshotsWithRetainLast() throws
IOException, InterruptedE
Assert.assertEquals(5, IterableUtils.size(table.snapshots()));
}
+ @Test
+ public void testExpireSnapshotsWithDefaultParams() throws IOException,
InterruptedException {
+ TableIdentifier identifier = TableIdentifier.of("default", "source");
+ Table table = testTables.createTableWithVersions(shell, identifier.name(),
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, fileFormat,
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS, 10);
+ // No snapshot should expire, since the max snapshot age to expire is by
default 5 days
+ shell.executeStatement("ALTER TABLE " + identifier.name() + " EXECUTE
EXPIRE_SNAPSHOTS RETAIN LAST 5");
+ table.refresh();
+ Assert.assertEquals(10, IterableUtils.size(table.snapshots()));
+
+ // Change max snapshot age to expire to 1 ms & min snapshots to keep as 4
& re-execute
Review Comment:
Done, thanx
--
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]