Class RelWriterImpl
- java.lang.Object
-
- org.apache.calcite.rel.externalize.RelWriterImpl
-
- All Implemented Interfaces:
RelWriter
- Direct Known Subclasses:
RelXmlWriter
public class RelWriterImpl extends java.lang.Object implements RelWriter
Implementation ofRelWriter
.
-
-
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
-
Constructor Summary
Constructors Constructor Description RelWriterImpl(java.io.PrintWriter pw)
RelWriterImpl(java.io.PrintWriter pw, SqlExplainLevel detailLevel, 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.
-
-
-
Field Detail
-
pw
protected final java.io.PrintWriter pw
-
detailLevel
private final SqlExplainLevel detailLevel
-
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)
-
explain
public final void explain(RelNode rel, java.util.List<Pair<java.lang.String,java.lang.Object>> valueList)
Description copied from interface:RelWriter
Prints an explanation of a node, with a list of (term, value) pairs.The term-value pairs are generally gathered by calling
RelNode.explain(RelWriter)
. Each sub-class ofRelNode
callsRelWriter.input(String, org.apache.calcite.rel.RelNode)
andRelWriter.item(String, Object)
to declare term-value pairs.
-
getDetailLevel
public SqlExplainLevel getDetailLevel()
- Specified by:
getDetailLevel
in interfaceRelWriter
- Returns:
- detail level at which plan should be generated
-
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.
-
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.
-
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.
-
done
public RelWriter done(RelNode node)
Description copied from interface:RelWriter
Writes the completed explanation.
-
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.
-
simple
public java.lang.String simple()
Converts the collected terms and values to a string. Does not write to the parent writer.
-
-