diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 72519be0cda2..f41d38eca31b 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -4088,9 +4088,9 @@ public static enum ConfVars { "If hive.server2.tez.initialize.default.sessions is enabled, the maximum number of\n" + "threads to use to initialize the default sessions."), HIVE_SERVER2_TEZ_SESSION_RESTRICTED_CONFIGS("hive.server2.tez.sessions.restricted.configs", "", - "The configuration settings that cannot be set when submitting jobs to HiveServer2. If\n" + - "any of these are set to values different from those in the server configuration, an\n" + - "exception will be thrown."), + "The configuration settings that cannot be set when submitting jobs to HiveServer2. If\n" + + "any of these are set to values different from those in the server configuration, an\n" + + "exception will be thrown."), HIVE_SERVER2_TEZ_SESSION_CUSTOM_QUEUE_ALLOWED("hive.server2.tez.sessions.custom.queue.allowed", "true", new StringSet("true", "false", "ignore"), "Whether Tez session pool should allow submitting queries to custom queues. The options\n" + diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java index 41bc79c935f5..0088493401fc 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java @@ -40,6 +40,8 @@ import org.apache.hadoop.hive.ql.wm.Trigger; import org.apache.hadoop.hive.ql.wm.TriggerActionHandler; import org.apache.hadoop.hive.shims.Utils; +import org.apache.hadoop.mapred.JobContext; +import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.tez.dag.api.TezConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -235,6 +237,10 @@ private TezSessionState getSession(HiveConf conf, boolean doOpen) throws Excepti // able to handle not being initialized. Perhaps we should get rid of the instance and // move the setupPool code to ctor. For now, at least hasInitialSessions will be false. String queueName = conf.get(TezConfiguration.TEZ_QUEUE_NAME); + String tez_queues = HiveConf.getVar(conf, ConfVars.HIVE_SERVER2_TEZ_DEFAULT_QUEUES); + if ((queueName == null || queueName.isEmpty()) && (tez_queues == null || tez_queues.isEmpty())) { + queueName = conf.get(JobContext.QUEUE_NAME, YarnConfiguration.DEFAULT_QUEUE_NAME); + } boolean hasQueue = (queueName != null) && !queueName.isEmpty(); if (hasQueue) { switch (customQueueAllowed) {