RussellSpitzer commented on code in PR #8755: URL: https://github.com/apache/iceberg/pull/8755#discussion_r1412642976
########## core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java: ########## @@ -500,4 +501,21 @@ public static Snapshot latestSnapshot(TableMetadata metadata, String branch) { return metadata.snapshot(ref.snapshotId()); } + + /** + * Checks if a particular branch of the table may contain deletes based on snapshot summary. + * + * @param table a {@link Table} + * @param branch branch name of the table (nullable) + * @return true if the branch may contain deletes + */ + public static boolean mayHaveDeletes(Table table, String branch) { + Snapshot snapshot = latestSnapshot(table, branch); + if (snapshot == null) { + return false; + } + + String value = snapshot.summary().get(SnapshotSummary.TOTAL_DELETE_FILES_PROP); Review Comment: Should we note here this is not a spec authorized field. A client is not required to put in TOTAL_DELET_FILES_PROP with the actual total number of delete files (although it would be weird if they did not) -- 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