shivadarshan-devadiga commented on code in PR #19027:
URL: https://github.com/apache/iceberg/pull/19027#discussion_r4731554063


##########
core/src/main/java/org/apache/iceberg/BaseRewriteManifests.java:
##########
@@ -284,17 +295,39 @@ private boolean matchesPredicate(ManifestFile manifest) {
   }
 
   private void validateDeletedManifests(
-      Set<ManifestFile> currentManifests, long currentSnapshotID) {
-    // directly deleted manifests must be still present in the current snapshot
-    deletedManifests.stream()
-        .filter(manifest -> !currentManifests.contains(manifest))
-        .findAny()
-        .ifPresent(
-            manifest -> {
-              throw new ValidationException(
-                  "Deleted manifest %s could not be found in the latest 
snapshot %d",
-                  manifest.path(), currentSnapshotID);
-            });
+      Map<String, ManifestFile> currentManifestsByPath, long 
currentSnapshotID) {
+    for (ManifestFile manifest : deletedManifests) {
+      // directly deleted manifests must be still present in the current 
snapshot
+      ManifestFile current = currentManifestsByPath.get(manifest.path());

Review Comment:
   Thanks, you're right, the by-path validation let such a manifest through 
where the old `contains` check rejected it. Done in fa46ae34a: `deleteManifest` 
now keeps a `GenericManifestFile` copy, which compares by path, so 
`keepActiveManifests` and `performRewrite` drop the current manifest as 
validation expects. `deleteManifestThatComparesByIdentity` deletes a manifest 
through a `ManifestFile` that compares by identity; without the change, the 
deleted manifest stays in the snapshot next to its replacement.



-- 
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]

Reply via email to