You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by he...@apache.org on 2011/11/16 19:21:52 UTC
svn commit: r1202820 -
/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
Author: heyongqiang
Date: Wed Nov 16 18:21:51 2011
New Revision: 1202820
URL: http://svn.apache.org/viewvc?rev=1202820&view=rev
Log:
HIVE-2581: explain task: getJSONPlan throws a NPE if the ast is null (namit via He Yongqiang)
Modified:
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java?rev=1202820&r1=1202819&r2=1202820&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java Wed Nov 16 18:21:51 2011
@@ -65,13 +65,15 @@ public class ExplainTask extends Task<Ex
}
// Print out the parse AST
- String jsonAST = outputAST(work.getAstStringTree(), out, jsonOutput, 0);
- if (out != null) {
- out.println();
- }
+ if (work.getAstStringTree() != null) {
+ String jsonAST = outputAST(work.getAstStringTree(), out, jsonOutput, 0);
+ if (out != null) {
+ out.println();
+ }
- if (jsonOutput) {
- outJSONObject.put("ABSTRACT SYNTAX TREE", jsonAST);
+ if (jsonOutput) {
+ outJSONObject.put("ABSTRACT SYNTAX TREE", jsonAST);
+ }
}
JSONObject jsonDependencies = outputDependencies(out, jsonOutput,