You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2018/07/05 23:39:53 UTC

hive git commit: HIVE-20067 : fix InsertEvent on mm tables to not cause failing capability checks (Zoltan Haindrich via Sankar H)

Repository: hive
Updated Branches:
  refs/heads/master cbcfab9eb -> ef53d69cc


HIVE-20067 : fix InsertEvent on mm tables to not cause failing capability checks (Zoltan Haindrich via Sankar H)

Signed-off-by: Ashutosh Chauhan <ha...@apache.org>


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

Branch: refs/heads/master
Commit: ef53d69cca57f46ed23b8ceb867fe18bd6206cf6
Parents: cbcfab9
Author: Zoltan Haindrich <ki...@rxd.hu>
Authored: Thu Jul 5 16:39:15 2018 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Thu Jul 5 16:39:15 2018 -0700

----------------------------------------------------------------------
 ql/src/test/queries/clientpositive/mm_all.q                 | 1 +
 .../org/apache/hadoop/hive/metastore/HiveMetaStore.java     | 2 +-
 .../apache/hadoop/hive/metastore/events/InsertEvent.java    | 9 +++++----
 3 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ef53d69c/ql/src/test/queries/clientpositive/mm_all.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/mm_all.q b/ql/src/test/queries/clientpositive/mm_all.q
index 61dd3e7..a524c29 100644
--- a/ql/src/test/queries/clientpositive/mm_all.q
+++ b/ql/src/test/queries/clientpositive/mm_all.q
@@ -3,6 +3,7 @@
 
 -- MASK_LINEAGE
 
+set hive.metastore.dml.events=true;
 set hive.mapred.mode=nonstrict;
 set hive.explain.user=false;
 set hive.fetch.task.conversion=none;

http://git-wip-us.apache.org/repos/asf/hive/blob/ef53d69c/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 31bf615..8d88749 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -7262,7 +7262,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
 
     private Table getTblObject(String db, String table) throws MetaException, NoSuchObjectException {
       GetTableRequest req = new GetTableRequest(db, table);
-      req.setCapabilities(new ClientCapabilities(Lists.newArrayList(ClientCapability.TEST_CAPABILITY)));
+      req.setCapabilities(new ClientCapabilities(Lists.newArrayList(ClientCapability.TEST_CAPABILITY, ClientCapability.INSERT_ONLY_TABLES)));
       return get_table_req(req).getTable();
     }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/ef53d69c/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/InsertEvent.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/InsertEvent.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/InsertEvent.java
index aa014e9..60ad7db 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/InsertEvent.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/events/InsertEvent.java
@@ -18,7 +18,9 @@
 
 package org.apache.hadoop.hive.metastore.events;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
 import org.apache.hadoop.hive.metastore.IHMSHandler;
@@ -33,8 +35,7 @@ import org.apache.hadoop.hive.metastore.api.Table;
 import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
 import org.apache.thrift.TException;
 
-import java.util.ArrayList;
-import java.util.List;
+import com.google.common.collect.Lists;
 
 @InterfaceAudience.Public
 @InterfaceStability.Stable
@@ -65,7 +66,7 @@ public class InsertEvent extends ListenerEvent {
     // TODO MS-SPLIT Switch this back once HiveMetaStoreClient is moved.
     //req.setCapabilities(HiveMetaStoreClient.TEST_VERSION);
     req.setCapabilities(new ClientCapabilities(
-      Lists.newArrayList(ClientCapability.TEST_CAPABILITY)));
+        Lists.newArrayList(ClientCapability.TEST_CAPABILITY, ClientCapability.INSERT_ONLY_TABLES)));
     try {
       this.tableObj = handler.get_table_req(req).getTable();
       if (partVals != null) {