Repository: hive
Updated Branches:
  refs/heads/master c50ebb34b -> cf3394de0


HIVE-18643 : don't check for archived partitions for ACID ops (Sergey 
Shelukhin, reviewed by Eugene Koifman)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/cf3394de
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/cf3394de
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/cf3394de

Branch: refs/heads/master
Commit: cf3394de0c811868aa9348fd997b7438dc6ed818
Parents: c50ebb3
Author: sergey <ser...@apache.org>
Authored: Wed Feb 7 11:47:49 2018 -0800
Committer: sergey <ser...@apache.org>
Committed: Wed Feb 7 11:47:49 2018 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/parse/SemanticAnalyzer.java  | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/cf3394de/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 9ccb4e5..e6ee968 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -110,6 +110,7 @@ import org.apache.hadoop.hive.ql.exec.UnionOperator;
 import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.hooks.ReadEntity;
 import org.apache.hadoop.hive.ql.hooks.WriteEntity;
+import org.apache.hadoop.hive.ql.hooks.WriteEntity.WriteType;
 import org.apache.hadoop.hive.ql.io.AcidInputFormat;
 import org.apache.hadoop.hive.ql.io.AcidOutputFormat;
 import org.apache.hadoop.hive.ql.io.AcidUtils;
@@ -12120,7 +12121,7 @@ public class SemanticAnalyzer extends 
BaseSemanticAnalyzer {
 
 
       if (type == WriteEntity.Type.PARTITION || type == 
WriteEntity.Type.DUMMYPARTITION) {
-        String conflictingArchive;
+        String conflictingArchive = null;
         try {
           Partition usedp = writeEntity.getPartition();
           Table tbl = usedp.getTable();
@@ -12134,8 +12135,14 @@ public class SemanticAnalyzer extends 
BaseSemanticAnalyzer {
 
           LOG.debug("validated " + usedp.getName());
           LOG.debug(usedp.getTable().getTableName());
-          conflictingArchive = ArchiveUtils
-              .conflictingArchiveNameOrNull(db, tbl, usedp.getSpec());
+          WriteEntity.WriteType writeType = writeEntity.getWriteType();
+          if (writeType != WriteType.UPDATE && writeType != WriteType.DELETE) {
+            // Do not check for ACID; it does not create new parts and this is 
expensive as hell.
+            // TODO: add an API to get table name list for archived parts with 
a single call;
+            //       nobody uses this so we could skip the whole thing.
+            conflictingArchive = ArchiveUtils
+                .conflictingArchiveNameOrNull(db, tbl, usedp.getSpec());
+          }
         } catch (HiveException e) {
           throw new SemanticException(e);
         }

Reply via email to