Class ExecNodePlanDumper

java.lang.Object
org.apache.flink.table.planner.plan.nodes.exec.utils.ExecNodePlanDumper

public class ExecNodePlanDumper extends Object
An utility class for converting an exec node plan to a string as a tree style.
  • Method Details

    • treeToString

      public static String treeToString(ExecNode<?> node)
      Converts an ExecNode tree to a string as a tree style.

      The following tree of ExecNode

      
             Sink
              |
             Join
           /      \
       Filter1  Filter2
          \     /
          Project
            |
          Scan
       

      would be converted to the tree style as following:

      
       Sink
       +- Join
          :- Filter1
          :  +- Project(reuse_id=[1])
          :     +- Scan
          +- Filter2
             +- Reused(reference_id=[1])
       
       }
      Parameters:
      node - the ExecNode to convert
      Returns:
      explain plan of ExecNode
    • treeToString

      public static String treeToString(ExecNode<?> node, List<ExecNode<?>> borders, boolean includingBorders)
      Converts an ExecNode tree to a string as a tree style.
      Parameters:
      node - the ExecNode to convert
      borders - node sets that stop visit when meet them
      includingBorders - Whether print the border nodes
      Returns:
      the plan of ExecNode
    • dagToString

      public static String dagToString(ExecNodeGraph execGraph)
      Converts an ExecNodeGraph to a string as a tree style. see dagToString(List).
    • dagToString

      public static String dagToString(List<ExecNode<?>> nodes)
      Converts an ExecNode DAG to a string as a tree style.

      The following DAG of ExecNode

      
          Sink1    Sink2
           |        |
        Filter3  Filter4
            \     /
             Join
           /      \
       Filter1  Filter2
          \     /
          Project
            |
          Scan
       

      would be converted to the tree style as following:

      
       Join(reuse_id=[2])
       :- Filter1
       :  +- Project(reuse_id=[1])
       :     +- Scan
       +- Filter2
          +- Reused(reference_id=[1])
      
       Sink1
       +- Filter3
          +- Reused(reference_id=[2])
      
       Sink2
       +- Filter4
          +- Reused(reference_id=[2])
       
      Parameters:
      nodes - the ExecNodes to convert
      Returns:
      the plan of ExecNode