Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 43635200B0F for ; Fri, 3 Jun 2016 05:46:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 42288160A52; Fri, 3 Jun 2016 03:46:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 86499160A51 for ; Fri, 3 Jun 2016 05:46:54 +0200 (CEST) Received: (qmail 94576 invoked by uid 500); 3 Jun 2016 03:46:53 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 94563 invoked by uid 99); 3 Jun 2016 03:46:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2016 03:46:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6E04EDFE65; Fri, 3 Jun 2016 03:46:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ekoifman@apache.org To: commits@hive.apache.org Message-Id: <1c12b8afa63f4a208d098b01a2184d26@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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, 3 Jun 2016 03:46:53 +0000 (UTC) archived-at: Fri, 03 Jun 2016 03:46:55 -0000 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 Authored: Thu Jun 2 20:44:24 2016 -0700 Committer: Eugene Koifman 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) {