hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekoif...@apache.org
Subject hive git commit: HIVE-13929 org.apache.hadoop.hive.metastore.api.DataOperationType class not found error when a job is submitted by hive (Eugene Koifman, reviewed by Ashutosh Chauhan)
Date Fri, 03 Jun 2016 03:46:53 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 d9b2001f0 -> ad244efe4


HIVE-13929 org.apache.hadoop.hive.metastore.api.DataOperationType class not found error when
a job is submitted by hive (Eugene Koifman, reviewed by Ashutosh Chauhan)


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

Branch: refs/heads/branch-1
Commit: ad244efe4550291a4b01927aef1545b84fd01d51
Parents: d9b2001
Author: Eugene Koifman <ekoifman@hortonworks.com>
Authored: Thu Jun 2 20:44:24 2016 -0700
Committer: Eugene Koifman <ekoifman@hortonworks.com>
Committed: Thu Jun 2 20:44:24 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/io/AcidUtils.java | 32 +++++++++++++-------
 .../apache/hadoop/hive/ql/metadata/Hive.java    |  2 +-
 2 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ad244efe/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
index cf93bc5..8bcf6d7 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java
@@ -219,17 +219,27 @@ public class AcidUtils {
   }
 
   public enum Operation {
-    NOT_ACID(DataOperationType.UNSET),
-    INSERT(DataOperationType.INSERT),
-    UPDATE(DataOperationType.UPDATE),
-    DELETE(DataOperationType.DELETE);
-    
-    private final DataOperationType dop;
-    private Operation(DataOperationType dop) {
-      this.dop = dop;
-    }
-    public DataOperationType toDataOperationType() {
-      return dop;
+    NOT_ACID, INSERT, UPDATE, DELETE;
+  }
+
+  /**
+   * Logically this should have been defined in Operation but that causes a dependency
+   * on metastore package from exec jar (from the cluster) which is not allowed.
+   * This method should only be called from client side where metastore.* classes are present.
+   * Not following this will not be caught by unit tests since they have all the jar loaded.
+   */
+  public static DataOperationType toDataOperationType(Operation op) {
+    switch (op) {
+      case NOT_ACID:
+        return DataOperationType.UNSET;
+      case INSERT:
+        return DataOperationType.INSERT;
+      case UPDATE:
+        return DataOperationType.UPDATE;
+      case DELETE:
+        return DataOperationType.DELETE;
+      default:
+        throw new IllegalArgumentException("Unexpected Operation: " + op);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/ad244efe/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
index 6362d23..4a0b685 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
@@ -1605,7 +1605,7 @@ private void constructOneLBLocationMap(FileStatus fSta,
           partNames.add(p.getName());
         }
         metaStoreClient.addDynamicPartitions(txnId, tbl.getDbName(), tbl.getTableName(),
-          partNames, operation.toDataOperationType());
+          partNames, AcidUtils.toDataOperationType(operation));
       }
       return partitionsMap;
     } catch (IOException e) {


Mime
View raw message