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.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 @@ private static boolean isIndexTableFresh(Hive hive, List indexes, Table s return hive.getIndexes(table.getTTable().getDbName(), table.getTTable().getTableName(), max); } - public static Task createRootTask(HiveConf builderConf, Set inputs, - Set outputs, StringBuilder command, + public static Task createRootTask( + HiveConf builderConf, + Set inputs, + Set outputs, + StringBuilder command, LinkedHashMap 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);