deniskuzZ commented on code in PR #4441:
URL: https://github.com/apache/hive/pull/4441#discussion_r1259341347
##########
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergExpireSnapshots.java:
##########
@@ -42,4 +43,26 @@ public void testExpireSnapshotsWithTimestamp() throws
IOException, InterruptedEx
table.refresh();
Assert.assertEquals(2, table.history().size());
}
+
+ @Test
+ public void testExpireSnapshotsWithSnapshotId() throws IOException,
InterruptedException {
+ TableIdentifier identifier = TableIdentifier.of("default", "source");
+ Table table = testTables.createTableWithVersions(shell, identifier.name(),
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, fileFormat,
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS, 10);
+ Assert.assertEquals(10, IterableUtils.size(table.snapshots()));
+
+ // Expire one snapshot
+ shell.executeStatement(
+ "ALTER TABLE " + identifier.name() + " EXECUTE EXPIRE_SNAPSHOTS" +
Review Comment:
weird syntax, why not
````
ALTER TABLE <table_name> EXPIRE SNAPSHOTS [older_than <value>] [ids]
````
--
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]