hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1202820 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
Date Wed, 16 Nov 2011 18:21:52 GMT
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,



Mime
View raw message