You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/04/05 13:51:49 UTC

[GitHub] [hive] pvary commented on a diff in pull request #3131: HIVE-26102: Implement DELETE statements for Iceberg tables

pvary commented on code in PR #3131:
URL: https://github.com/apache/hive/pull/3131#discussion_r842811770


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java:
##########
@@ -118,18 +120,23 @@ public void commitTask(TaskAttemptContext originalContext) throws IOException {
           .run(output -> {
             Table table = HiveIcebergStorageHandler.table(context.getJobConf(), output);
             if (table != null) {
-              HiveIcebergRecordWriter writer = writers.get(output);
-              DataFile[] closedFiles;
+              HiveIcebergWriter writer = writers.get(output);
+              HiveIcebergWriter delWriter = delWriters.get(output);
+              String fileForCommitLocation = generateFileForCommitLocation(table.location(), jobConf,
+                  attemptID.getJobID(), attemptID.getTaskID().getId());
+              if (delWriter != null) {
+                DeleteFile[] closedFiles = delWriter.deleteFiles().toArray(new DeleteFile[0]);
+                createFileForCommit(closedFiles, fileForCommitLocation, table.io());

Review Comment:
   would it make sense to write into a single `forCommit` file?



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org