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


##########
core/src/main/java/org/apache/iceberg/io/BaseTaskWriter.java:
##########
@@ -345,12 +348,17 @@ private void closeCurrent() throws IOException {
           currentWriter.close();
 
           if (currentRows == 0L) {
-            try {
-              io.deleteFile(currentFile.encryptingOutputFile());
-            } catch (UncheckedIOException e) {
-              // the file may not have been created, and it isn't worth 
failing the job to clean up,
-              // skip deleting
-            }
+            // the file may not have been created or cannot be deleted, and it 
isn't worth failing
+            // the job to clean up, skip deleting
+            Tasks.foreach(currentFile.encryptingOutputFile())
+                .suppressFailureWhenFinished()
+                .onFailure(
+                    (file, exc) ->
+                        LOG.warn(
+                            "Failed to delete the empty file during writer 
clean up: {}",

Review Comment:
   Or if we want to say "empty" to avoid user confusion on what's attempted to 
be deleted in the logs, I'd actually go a step further and say "uncommitted 
empty file". The uncommitted part is actually important to indicate to a user 
that we're not deleting anything that's part of their table.



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