You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by su...@apache.org on 2015/08/29 21:58:25 UTC

hive git commit: "Alter index rebuild" statements submitted through HiveServer2 fail when Sentry is enabled (Aihua Xu, reviewed by Chao Sun and Ashutosh Chauhan)

Repository: hive
Updated Branches:
  refs/heads/master af91308e5 -> dcf21cd6f


"Alter index rebuild" statements submitted through HiveServer2 fail when Sentry is enabled (Aihua Xu, reviewed by Chao Sun and Ashutosh Chauhan)


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

Branch: refs/heads/master
Commit: dcf21cd6fa98fb5db01ef661bb3b9f94d9ca2d15
Parents: af91308
Author: Aihua Xu <ai...@gmail.com>
Authored: Sat Aug 29 12:57:52 2015 -0700
Committer: Chao Sun <su...@apache.org>
Committed: Sat Aug 29 12:57:52 2015 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/optimizer/IndexUtils.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/dcf21cd6/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java
index 92cae67..0b30258 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/IndexUtils.java
@@ -49,6 +49,7 @@ import org.apache.hadoop.hive.ql.optimizer.physical.index.IndexWhereProcessor;
 import org.apache.hadoop.hive.ql.parse.ParseContext;
 import org.apache.hadoop.hive.ql.parse.PrunedPartitionList;
 import org.apache.hadoop.hive.ql.parse.SemanticException;
+import org.apache.hadoop.hive.ql.session.SessionState;
 
 /**
  * Utility class for index support.
@@ -213,13 +214,17 @@ public final class IndexUtils {
     return hive.getIndexes(table.getTTable().getDbName(), table.getTTable().getTableName(), max);
   }
 
-  public static Task<?> createRootTask(HiveConf builderConf, Set<ReadEntity> inputs,
-      Set<WriteEntity> outputs, StringBuilder command,
+  public static Task<?> createRootTask(
+      HiveConf builderConf,
+      Set<ReadEntity> inputs,
+      Set<WriteEntity> outputs,
+      StringBuilder command,
       LinkedHashMap<String, String> partSpec,
-      String indexTableName, String dbName){
+      String indexTableName,
+      String dbName){
     // Don't try to index optimize the query to build the index
     HiveConf.setBoolVar(builderConf, HiveConf.ConfVars.HIVEOPTINDEXFILTER, false);
-    Driver driver = new Driver(builderConf);
+    Driver driver = new Driver(builderConf, SessionState.get().getUserName());
     driver.compile(command.toString(), false);
 
     Task<?> rootTask = driver.getPlan().getRootTasks().get(0);