mukund-thakur commented on code in PR #15436:
URL: https://github.com/apache/iceberg/pull/15436#discussion_r3319481608


##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopFileIO.java:
##########
@@ -250,6 +224,7 @@ public void deleteFiles(Iterable<String> pathsToDelete) 
throws BulkDeletionFailu
               failureCount.incrementAndGet();
             })
         .run(this::deleteFile);
+

Review Comment:
   nit: remove this extra new line.



##########
core/src/main/java/org/apache/iceberg/hadoop/BulkDeleter.java:
##########
@@ -277,16 +302,36 @@ Set<Path> snapshotDeletedFiles() {
      * Delete a single batch of paths.
      *
      * @param paths paths to delete.
-     * @return the list of paths which couldn't be deleted.
+     * @return An outcome containing the list of paths which couldn't be 
deleted.
      * @throws UncheckedIOException if an IOE was raised in the invoked 
methods.
      */
-    List<Map.Entry<Path, String>> deleteBatch(Collection<Path> paths) {
+    Outcome deleteBatch(Collection<Path> paths) {
       LOG.debug("Deleting batch of {} paths", paths.size());
       try {
-        return bulkDelete.bulkDelete(paths);
+        return new Outcome(
+            bulkDelete().bulkDelete(paths).stream()
+                .map(e -> new DeleteFailure(e.getKey(), e.getValue()))
+                .toList());
       } catch (IOException e) {
         throw new UncheckedIOException(e);
       }
     }
   }
+
+  /**
+   * A failure to delete a single path.
+   *
+   * @param path path which couldn't be deleted
+   * @param errorText error text
+   */
+  @VisibleForTesting
+  record DeleteFailure(Path path, String errorText) {}

Review Comment:
   good use of record. 



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