Class RelWriterImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private SqlExplainLevel detailLevel  
      protected java.io.PrintWriter pw  
      protected org.apache.calcite.avatica.util.Spacer spacer  
      private java.util.List<Pair<java.lang.String,​java.lang.Object>> values  
      private boolean withIdPrefix  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean checkInputsPresentInExplain​(RelNode node)  
      RelWriter done​(RelNode node)
      Writes the completed explanation.
      void explain​(RelNode rel, java.util.List<Pair<java.lang.String,​java.lang.Object>> valueList)
      Prints an explanation of a node, with a list of (term, value) pairs.
      protected void explain_​(RelNode rel, java.util.List<Pair<java.lang.String,​java.lang.Object>> values)  
      private void explainInputs​(java.util.List<RelNode> inputs)  
      SqlExplainLevel getDetailLevel()  
      RelWriter input​(java.lang.String term, RelNode input)
      Adds an input to the explanation of the current node.
      RelWriter item​(java.lang.String term, java.lang.Object value)
      Adds an attribute to the explanation of the current node.
      RelWriter itemIf​(java.lang.String term, java.lang.Object value, boolean condition)
      Adds an input to the explanation of the current node, if a condition holds.
      boolean nest()
      Returns whether the writer prefers nested values.
      java.lang.String simple()
      Converts the collected terms and values to a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pw

        protected final java.io.PrintWriter pw
      • withIdPrefix

        private final boolean withIdPrefix
      • spacer

        protected final org.apache.calcite.avatica.util.Spacer spacer
      • values

        private final java.util.List<Pair<java.lang.String,​java.lang.Object>> values
    • Constructor Detail

      • RelWriterImpl

        public RelWriterImpl​(java.io.PrintWriter pw)
      • RelWriterImpl

        public RelWriterImpl​(java.io.PrintWriter pw,
                             SqlExplainLevel detailLevel,
                             boolean withIdPrefix)
    • Method Detail

      • explain_

        protected void explain_​(RelNode rel,
                                java.util.List<Pair<java.lang.String,​java.lang.Object>> values)
      • explainInputs

        private void explainInputs​(java.util.List<RelNode> inputs)
      • input

        public RelWriter input​(java.lang.String term,
                               RelNode input)
        Description copied from interface: RelWriter
        Adds an input to the explanation of the current node.
        Specified by:
        input in interface RelWriter
        Parameters:
        term - Term for input, e.g. "left" or "input #1".
        input - Input relational expression
      • item

        public RelWriter item​(java.lang.String term,
                              java.lang.Object value)
        Description copied from interface: RelWriter
        Adds an attribute to the explanation of the current node.
        Specified by:
        item in interface RelWriter
        Parameters:
        term - Term for attribute, e.g. "joinType"
        value - Attribute value
      • itemIf

        public RelWriter itemIf​(java.lang.String term,
                                java.lang.Object value,
                                boolean condition)
        Description copied from interface: RelWriter
        Adds an input to the explanation of the current node, if a condition holds.
        Specified by:
        itemIf in interface RelWriter
      • checkInputsPresentInExplain

        private boolean checkInputsPresentInExplain​(RelNode node)
      • nest

        public boolean nest()
        Description copied from interface: RelWriter
        Returns whether the writer prefers nested values. Traditional explain writers prefer flattened values.
        Specified by:
        nest in interface RelWriter
      • simple

        public java.lang.String simple()
        Converts the collected terms and values to a string. Does not write to the parent writer.