You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/01/15 02:35:05 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1759: [CALCITE-3676] VolcanoPlanner. dumpGraphviz should handle exception

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_r366671373
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
 ##########
 @@ -1117,22 +1117,27 @@ public void setImportance(RelNode rel, double importance) {
    * @see #normalizePlan(String)
    */
   public void dump(PrintWriter pw) {
-    pw.println("Root: " + root);
-    pw.println("Original rel:");
+    try {
+      pw.println("Root: " + root);
+      pw.println("Original rel:");
 
-    if (originalRoot != null) {
-      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()) {
-      pw.println();
-      pw.println("Graphviz:");
-      dumpGraphviz(pw);
+      if (originalRoot != null) {
+        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()) {
+        pw.println();
+        pw.println("Graphviz:");
+        dumpGraphviz(pw);
+      }
+    } catch (Exception ex) {
+      throw new AssertionError("Dumps the internal state ", ex);
 
 Review comment:
   If we change this way, we won't see CannotPlanException

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services