Skip to content

Commit 9bb14be

Browse files
Bharathkrishna Guruvayoor MuraliSzehon Ho
authored andcommitted
HIVE-18469 : HS2UI: Introduce separate option to show query on web ui (Bharathkrishna Guruvayoor Murali reviewed by Zoltan Haindrich and Vihang Karajgaonkar)
1 parent 964469f commit 9bb14be

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

common/src/java/org/apache/hadoop/hive/conf/HiveConf.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,9 @@ public static enum ConfVars {
18091809
"HTTP/[email protected]", "The HiveServer2 WebUI SPNEGO service principal.\n" +
18101810
"The special string _HOST will be replaced automatically with \n" +
18111811
"the value of hive.server2.webui.host or the correct host name."),
1812+
HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT("hive.server2.webui.explain.output", false,
1813+
"When set to true, the EXPLAIN output for every query is displayed"
1814+
+ " in the HS2 WebUI / Drilldown / Query Plan tab.\n"),
18121815

18131816
// Configuration for async thread pool in SessionManager
18141817
HIVE_SERVER2_ASYNC_EXEC_THREADS("hive.server2.async.exec.threads", 100,
@@ -3184,4 +3187,4 @@ public static boolean isLoadHiveServer2Config() {
31843187
public static void setLoadHiveServer2Config(boolean loadHiveServer2Config) {
31853188
HiveConf.loadHiveServer2Config = loadHiveServer2Config;
31863189
}
3187-
}
3190+
}

ql/src/java/org/apache/hadoop/hive/ql/Driver.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,15 @@ public Map<String, String> getHiveVariable() {
548548
}
549549
}
550550

551-
if (conf.getBoolVar(ConfVars.HIVE_LOG_EXPLAIN_OUTPUT)) {
551+
if (conf.getBoolVar(ConfVars.HIVE_LOG_EXPLAIN_OUTPUT)
552+
|| conf.getBoolVar(ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT)) {
552553
String explainOutput = getExplainOutput(sem, plan, tree.dump());
553554
if (explainOutput != null) {
554555
if (conf.getBoolVar(ConfVars.HIVE_LOG_EXPLAIN_OUTPUT)) {
555-
LOG.info("EXPLAIN output for queryid " + queryId + " : "
556-
+ explainOutput);
556+
LOG.info("EXPLAIN output for queryid " + queryId + " : " + explainOutput);
557557
}
558-
if (conf.isWebUiQueryInfoCacheEnabled()) {
558+
if (conf.isWebUiQueryInfoCacheEnabled()
559+
&& conf.getBoolVar(ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT)) {
559560
queryDisplay.setExplainPlan(explainOutput);
560561
}
561562
}

0 commit comments

Comments
 (0)