amogh-jahagirdar commented on code in PR #9183:
URL: https://github.com/apache/iceberg/pull/9183#discussion_r1414595426


##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -446,20 +446,16 @@ private void commitSimpleTransaction() {
       }
 
       Set<String> committedFiles = committedFiles(ops, newSnapshots);
-      if (committedFiles != null) {
-        // delete all of the files that were deleted in the most recent set of 
operation commits
-        Tasks.foreach(deletedFiles)
-            .suppressFailureWhenFinished()
-            .onFailure((file, exc) -> LOG.warn("Failed to delete uncommitted 
file: {}", file, exc))
-            .run(
-                path -> {
-                  if (!committedFiles.contains(path)) {
-                    ops.io().deleteFile(path);
-                  }
-                });
-      } else {
-        LOG.warn("Failed to load metadata for a committed snapshot, skipping 
clean-up");
-      }
+      // delete all of the files that were deleted in the most recent set of 
operation commits
+      Tasks.foreach(deletedFiles)
+          .suppressFailureWhenFinished()
+          .onFailure((file, exc) -> LOG.warn("Failed to delete uncommitted 
file: {}", file, exc))
+          .run(
+              path -> {
+                if (committedFiles == null || !committedFiles.contains(path)) {

Review Comment:
   I just realized alternatively we could've just returned an empty set in 
`committedFiles` instead of null and then could've removed the  (committedFiles 
== null) check (in addition to the current top level check). I'm not super 
opinionated on that though (it can be done in a follow on)



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

Reply via email to