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 2021/06/10 07:49:55 UTC

[GitHub] [hive] pvary commented on a change in pull request #2359: HIVE-25208: Refactor Iceberg commit to the MoveTask/MoveWork

pvary commented on a change in pull request #2359:
URL: https://github.com/apache/hive/pull/2359#discussion_r648936862



##########
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:
       Ok. Did the full refactoring then




-- 
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:
users@infra.apache.org



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