You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pv...@apache.org on 2017/08/15 16:05:10 UTC
hive git commit: HIVE-17268: WebUI / QueryPlan: query plan is
sometimes null when explain output conf is on (Karen Coppage via Peter Vary)
Repository: hive
Updated Branches:
refs/heads/master 7ce966a06 -> d3b820f64
HIVE-17268: WebUI / QueryPlan: query plan is sometimes null when explain output conf is on (Karen Coppage via Peter Vary)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/d3b820f6
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d3b820f6
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d3b820f6
Branch: refs/heads/master
Commit: d3b820f641355b2bc355c5be5b76f38b028edc2c
Parents: 7ce966a
Author: Peter Vary <pv...@cloudera.com>
Authored: Tue Aug 15 18:04:26 2017 +0200
Committer: Peter Vary <pv...@cloudera.com>
Committed: Tue Aug 15 18:04:26 2017 +0200
----------------------------------------------------------------------
.../hive/service/cli/session/TestQueryDisplay.java | 3 ++-
.../java/org/apache/hadoop/hive/ql/QueryDisplay.java | 2 +-
.../jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon | 14 +++++++++++---
.../hive/service/servlet/QueryProfileServlet.java | 4 +++-
4 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/d3b820f6/itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java
----------------------------------------------------------------------
diff --git a/itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java b/itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java
index 155c65d..da01a29 100644
--- a/itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java
+++ b/itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java
@@ -172,7 +172,8 @@ public class TestQueryDisplay {
StringWriter sw = new StringWriter();
QueryInfo queryInfo = sessionManager.getOperationManager().getQueryInfo(
opHandle);
- new QueryProfileTmpl().render(sw, queryInfo);
+ HiveConf hiveConf = sessionManager.getOperationManager().getHiveConf();
+ new QueryProfileTmpl().render(sw, queryInfo, hiveConf);
String html = sw.toString();
Assert.assertTrue(html.contains(stmt));
http://git-wip-us.apache.org/repos/asf/hive/blob/d3b820f6/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java b/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
index 5bf2210..bf6cb91 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/QueryDisplay.java
@@ -207,7 +207,7 @@ public class QueryDisplay {
}
public synchronized String getExplainPlan() {
- return explainPlan == null ? "SET hive.log.explain.output TO true TO VIEW PLANS" : explainPlan;
+ return returnStringOrUnknown(explainPlan);
}
public synchronized void setExplainPlan(String explainPlan) {
http://git-wip-us.apache.org/repos/asf/hive/blob/d3b820f6/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
----------------------------------------------------------------------
diff --git a/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon b/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
index 5e2d68c..ff7476e 100644
--- a/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
+++ b/service/src/jamon/org/apache/hive/tmpl/QueryProfileTmpl.jamon
@@ -18,11 +18,13 @@ limitations under the License.
</%doc>
<%args>
QueryInfo queryInfo;
+HiveConf hiveConf;
</%args>
<%import>
java.util.*;
org.apache.hadoop.hive.ql.QueryDisplay;
org.apache.hadoop.hive.ql.QueryInfo;
+org.apache.hadoop.hive.conf.HiveConf;
</%import>
<!--[if IE]>
<!DOCTYPE html>
@@ -204,9 +206,15 @@ org.apache.hadoop.hive.ql.QueryInfo;
<div class="panel panel-default">
<div class="panel-heading">Explain plan</div>
<div class="panel-body">
- <pre>
- <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getExplainPlan() %>
- </pre>
+ <%if hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_LOG_EXPLAIN_OUTPUT) %>
+ <pre>
+ <% queryInfo.getQueryDisplay() == null ? "Unknown" : queryInfo.getQueryDisplay().getExplainPlan() %>
+ </pre>
+ <%else>
+ <pre>
+ Set configuration hive.log.explain.output to true to view future query plans
+ </pre>
+ </%if>
</div>
</div>
</%def>
http://git-wip-us.apache.org/repos/asf/hive/blob/d3b820f6/service/src/java/org/apache/hive/service/servlet/QueryProfileServlet.java
----------------------------------------------------------------------
diff --git a/service/src/java/org/apache/hive/service/servlet/QueryProfileServlet.java b/service/src/java/org/apache/hive/service/servlet/QueryProfileServlet.java
index 27a3b14..4996374 100644
--- a/service/src/java/org/apache/hive/service/servlet/QueryProfileServlet.java
+++ b/service/src/java/org/apache/hive/service/servlet/QueryProfileServlet.java
@@ -17,6 +17,7 @@
*/
package org.apache.hive.service.servlet;
+import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.ql.QueryInfo;
import org.apache.hive.service.cli.operation.OperationManager;
import org.apache.hive.service.cli.session.SessionManager;
@@ -47,11 +48,12 @@ public class QueryProfileServlet extends HttpServlet {
(SessionManager)ctx.getAttribute("hive.sm");
OperationManager opManager = sessionManager.getOperationManager();
QueryInfo queryInfo = opManager.getQueryInfo(opId);
+ HiveConf hiveConf = opManager.getHiveConf();
if (queryInfo == null) {
LOG.debug("No display object found for operation {} ", opId);
return;
}
- new QueryProfileTmpl().render(response.getWriter(), queryInfo);
+ new QueryProfileTmpl().render(response.getWriter(), queryInfo, hiveConf);
}
}