amogh-jahagirdar commented on code in PR #10983: URL: https://github.com/apache/iceberg/pull/10983#discussion_r1737259547
########## core/src/main/java/org/apache/iceberg/RemoveSnapshots.java: ########## @@ -321,6 +323,14 @@ ExpireSnapshots withIncrementalCleanup(boolean useIncrementalCleanup) { private void cleanExpiredSnapshots() { TableMetadata current = ops.refresh(); + if (specifySnapshotIds) { + if (incrementalCleanup != null && incrementalCleanup) { + throw new UnsupportedOperationException( + "Cannot incrementally clean files when expiring snapshots through specified ids"); + } + incrementalCleanup = false; Review Comment: Style nit: Newline after the if block ########## core/src/test/java/org/apache/iceberg/TestRemoveSnapshots.java: ########## @@ -1171,6 +1172,27 @@ public void testBranchExpiration() { assertThat(table.ops().current().ref(SnapshotRef.MAIN_BRANCH)).isNotNull(); } + @TestTemplate + public void testSpecifySnapshotIdsAndCleanExpiredFilesFailsForIncrementalCleanup() { Review Comment: `testIncrementalCleanupFailsWhenExpiringSnapshotId`? ########## core/src/main/java/org/apache/iceberg/RemoveSnapshots.java: ########## @@ -116,6 +117,7 @@ public ExpireSnapshots cleanExpiredFiles(boolean clean) { public ExpireSnapshots expireSnapshotId(long expireSnapshotId) { LOG.info("Expiring snapshot with id: {}", expireSnapshotId); idsToRemove.add(expireSnapshotId); + specifySnapshotIds = true; Review Comment: `specifiedSnapshotId`? Even though there can be multiple I don't think we need to emphasize that in the name, it doesn't make a difference in terms of the validation that gets done. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org