diff --git a/service/src/java/org/apache/hive/service/server/HiveServer2.java b/service/src/java/org/apache/hive/service/server/HiveServer2.java index 58b8fb4..164c914 100644 --- a/service/src/java/org/apache/hive/service/server/HiveServer2.java +++ b/service/src/java/org/apache/hive/service/server/HiveServer2.java @@ -287,12 +287,14 @@ private void initializeWorkloadManagement(HiveConf hiveConf, Hive sessionHive) { LOG.warn("Workload management is enabled but there's no resource plan"); } - // Initialize workload management. - LOG.info("Initializing workload management"); - try { - wm = WorkloadManager.create(wmQueue, hiveConf, resourcePlan); - } catch (ExecutionException | InterruptedException e) { - throw new ServiceException("Unable to instantiate Workload Manager", e); + if (hasQueue) { + // Initialize workload management. + LOG.info("Initializing workload management"); + try { + wm = WorkloadManager.create(wmQueue, hiveConf, resourcePlan); + } catch (ExecutionException | InterruptedException e) { + throw new ServiceException("Unable to instantiate Workload Manager", e); + } } if (resourcePlan != null) {