hsyuan commented on a change in pull request #1759: [CALCITE-3676] 
VolcanoPlanner. dumpGraphviz should handle exception
URL: https://github.com/apache/calcite/pull/1759#discussion_r368235338
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
 ##########
 @@ -1124,15 +1124,22 @@ public void dump(PrintWriter pw) {
       originalRoot.explain(
           new RelWriterImpl(pw, SqlExplainLevel.ALL_ATTRIBUTES, false));
     }
-    if (CalciteSystemProperty.DUMP_SETS.value()) {
-      pw.println();
-      pw.println("Sets:");
-      dumpSets(pw);
-    }
-    if (CalciteSystemProperty.DUMP_GRAPHVIZ.value()) {
+
+    try {
+      if (CalciteSystemProperty.DUMP_SETS.value()) {
+        pw.println();
+        pw.println("Sets:");
+        dumpSets(pw);
+      }
+      if (CalciteSystemProperty.DUMP_GRAPHVIZ.value()) {
+        pw.println();
+        pw.println("Graphviz:");
+        dumpGraphviz(pw);
+      }
+    } catch (Exception | AssertionError ex) {
+      pw.print("When Dumping the internal state :");
       pw.println();
-      pw.println("Graphviz:");
-      dumpGraphviz(pw);
+      pw.print(ex);
 
 Review comment:
   Can we change to
   ```
   pw.println("Error when dumping plan state: \n" + e);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to