deniskuzZ commented on code in PR #5251:
URL: https://github.com/apache/hive/pull/5251#discussion_r1644183955


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java:
##########
@@ -773,22 +801,77 @@ public List<FileStatus> getOutputFiles(List<JobContext> 
jobContexts) throws IOEx
                 FilesForCommit results = collectResults(numTasks, 
fileExecutor, table.location(), jobContext,
                         table.io(), false);
                 for (DataFile dataFile : results.dataFiles()) {
-                  FileStatus fileStatus = fileSystem.getFileStatus(new 
Path(dataFile.path().toString()));
-                  dataFiles.add(fileStatus);
+                  Path filePath = new Path(dataFile.path().toString());
+                  FileStatus fileStatus = fileSystem.getFileStatus(filePath);
+                  parentDirToDataFile.merge(
+                      filePath.getParent(), Lists.newArrayList(fileStatus), 
(oldList, newList) -> {
+                      oldList.addAll(newList);
+                      return oldList;
+                    });
                 }
+                for (DeleteFile deleteFile : results.deleteFiles()) {
+                  Path filePath = new Path(deleteFile.path().toString());
+                  FileStatus fileStatus = fileSystem.getFileStatus(filePath);
+                  parentDirToDeleteFile.merge(
+                      filePath.getParent(), Lists.newArrayList(fileStatus), 
(oldList, newList) -> {
+                      oldList.addAll(newList);
+                      return oldList;
+                    });
+                }
+              }, IOException.class);
+    } finally {
+      fileExecutor.shutdown();
+      if (tableExecutor != null) {
+        tableExecutor.shutdown();
+      }
+    }
+    List<FileStatus> dataFiles = Lists.newArrayList();
+    dataFiles.addAll(parentDirToDataFile.values().stream()
+        .flatMap(List::stream).collect(Collectors.toList()));
+    dataFiles.addAll(parentDirToDeleteFile.values().stream()
+        .flatMap(List::stream).collect(Collectors.toList()));
+    return dataFiles;
+  }
+
+  public List<ContentFile> getOutputContentFiles(List<JobContext> jobContexts) 
throws IOException {

Review Comment:
   what `contentFile` means? it's the same as `getFiles`, but what are those 
files? getOutputFiles? could you please add javadoc



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