rdblue commented on a change in pull request #2985:
URL: https://github.com/apache/iceberg/pull/2985#discussion_r711801496



##########
File path: core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java
##########
@@ -536,36 +544,41 @@ private ManifestFile newFilesAsManifest() {
   }
 
   private Iterable<ManifestFile> prepareDeleteManifests() {
-    if (newDeleteFiles.isEmpty()) {
+    if (newDeleteFilesBySpec.isEmpty()) {
       return ImmutableList.of();
     }
 
-    return ImmutableList.of(newDeleteFilesAsManifest());
+    return newDeleteFilesAsManifests();
   }
 
-  private ManifestFile newDeleteFilesAsManifest() {
-    if (hasNewDeleteFiles && cachedNewDeleteManifest != null) {
-      deleteFile(cachedNewDeleteManifest.path());
-      cachedNewDeleteManifest = null;
+  private List<ManifestFile> newDeleteFilesAsManifests() {
+    if (hasNewDeleteFiles && cachedNewDeleteManifests.size() > 0) {
+      for (ManifestFile cachedNewDeleteManifest : cachedNewDeleteManifests) {
+        deleteFile(cachedNewDeleteManifest.path());
+      }
+      cachedNewDeleteManifests.clear();

Review comment:
       Minor: this will rewrite all delete manifests even if there is only one 
new delete file. I think it's fine to simplify it right now since we don't 
expect this case very often. But it would be good to note that this is 
something we can improve in a comment.




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