rdblue closed pull request #46: Do not scan manifests with no deletes when expiring snapshots. URL: https://github.com/apache/incubator-iceberg/pull/46
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/src/main/java/com/netflix/iceberg/RemoveSnapshots.java b/core/src/main/java/com/netflix/iceberg/RemoveSnapshots.java index 541cc5f..4784dd1 100644 --- a/core/src/main/java/com/netflix/iceberg/RemoveSnapshots.java +++ b/core/src/main/java/com/netflix/iceberg/RemoveSnapshots.java @@ -162,8 +162,11 @@ public void commit() { .onFailure((item, exc) -> LOG.warn("Failed to get deleted files: this may cause orphaned data files", exc) ).run(manifest -> { - // even if the manifest is still used, it may contain files that can be deleted - // TODO: eliminate manifests with no deletes without scanning + if (manifest.deletedFilesCount() != null && manifest.deletedFilesCount() == 0) { + return; + } + + // the manifest has deletes, scan it to find files to delete try (ManifestReader reader = ManifestReader.read(ops.io().newInputFile(manifest.path()))) { for (ManifestEntry entry : reader.entries()) { // if the snapshot ID of the DELETE entry is no longer valid, the data can be deleted ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services