FAQ
Repository: hive
Updated Branches:
   refs/heads/master 6d8b9d2d7 -> 3b04ce3d1


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/3b04ce3d
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/3b04ce3d
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/3b04ce3d

Branch: refs/heads/master
Commit: 3b04ce3d14d70d2bb08a3c02022b4efe85e00645
Parents: 6d8b9d2
Author: Eugene Koifman <ekoifman@hortonworks.com>
Authored: Thu Jun 2 19:56:04 2016 -0700
Committer: Eugene Koifman <ekoifman@hortonworks.com>
Committed: Thu Jun 2 19:56:16 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/3b04ce3d/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 496bd0f..36f38f6 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
@@ -223,17 +223,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/3b04ce3d/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 ee6c564..3a7d3bb 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
@@ -1760,7 +1760,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) {

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 3, '16 at 3:42a
activeJun 3, '16 at 3:46a
posts3
users1
websitehive.apache.org

1 user in discussion

Ekoifman: 3 posts

People

Translate

site design / logo © 2021 Grokbase