Skip to content

Commit edc5f95

Browse files
HIVE-29293: Restrict config 'mapreduce.job.queuename' at tez session (#6155)
* HIVE-29293: Restrict config 'mapreduce.job.queuename' at tez session * Address review comments * Address test failures * Address review comments * indentation issue
1 parent fdccac6 commit edc5f95

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
import org.apache.hadoop.hive.ql.wm.Trigger;
4141
import org.apache.hadoop.hive.ql.wm.TriggerActionHandler;
4242
import org.apache.hadoop.hive.shims.Utils;
43+
import org.apache.hadoop.mapred.JobContext;
44+
import org.apache.hadoop.yarn.conf.YarnConfiguration;
4345
import org.apache.tez.dag.api.TezConfiguration;
4446
import org.slf4j.Logger;
4547
import org.slf4j.LoggerFactory;
@@ -235,6 +237,10 @@ private TezSessionState getSession(HiveConf conf, boolean doOpen) throws Excepti
235237
// able to handle not being initialized. Perhaps we should get rid of the instance and
236238
// move the setupPool code to ctor. For now, at least hasInitialSessions will be false.
237239
String queueName = conf.get(TezConfiguration.TEZ_QUEUE_NAME);
240+
String tezQueues = HiveConf.getVar(conf, ConfVars.HIVE_SERVER2_TEZ_DEFAULT_QUEUES);
241+
if ((queueName == null || queueName.isEmpty()) && (tezQueues == null || tezQueues.isEmpty())) {
242+
queueName = conf.get(JobContext.QUEUE_NAME, YarnConfiguration.DEFAULT_QUEUE_NAME);
243+
}
238244
boolean hasQueue = (queueName != null) && !queueName.isEmpty();
239245
if (hasQueue) {
240246
switch (customQueueAllowed) {

0 commit comments

Comments
 (0)