[ 
https://issues.apache.org/jira/browse/HIVE-25208?focusedWorklogId=609505&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609505
 ]

ASF GitHub Bot logged work on HIVE-25208:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Jun/21 07:20
            Start Date: 10/Jun/21 07:20
    Worklog Time Spent: 10m 
      Work Description: marton-bod commented on a change in pull request #2359:
URL: https://github.com/apache/hive/pull/2359#discussion_r648915562



##########
File path: 
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java
##########
@@ -265,6 +273,28 @@ public String getFileFormatPropertyKey() {
     return TableProperties.DEFAULT_FILE_FORMAT;
   }
 
+  @Override
+  public boolean useNativeCommit() {
+    return true;
+  }
+
+  @Override
+  public void nativeCommit(Properties commitProperties, boolean overwrite) 
throws HiveException {
+    String tableName = commitProperties.getProperty(Catalogs.NAME);
+    Configuration configuration = SessionState.getSessionConf();
+    Optional<JobContext> jobContext = 
getJobContextForCommitOrAbort(configuration, tableName, overwrite);
+    if (jobContext.isPresent()) {
+      try {
+        OutputCommitter committer = new HiveIcebergOutputCommitter();
+        committer.commitJob(jobContext.get());
+      } catch (Throwable e) {
+        LOG.error("Error while trying to commit job, starting rollback", e);
+        rollbackInsertTable(configuration, tableName, overwrite);

Review comment:
       Maybe it's enough to pass in the `jobContext` to this method?  
`getJobContextForCommitOrAbort` should give back the same result on the second 
invocation too




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

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 609505)
    Time Spent: 20m  (was: 10m)

> Refactor Iceberg commit to the MoveTask/MoveWork
> ------------------------------------------------
>
>                 Key: HIVE-25208
>                 URL: https://issues.apache.org/jira/browse/HIVE-25208
>             Project: Hive
>          Issue Type: Improvement
>          Components: Hive
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Instead of committing Iceberg changes in `DefaultMetaHook.preCommitInsert` we 
> should commit in MoveWork so we are using the same flow as normal tables.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to