Package org.apache.calcite.rel.mutable
Class MutableRel
java.lang.Object
org.apache.calcite.rel.mutable.MutableRel
- Direct Known Subclasses:
Holder,MutableAggregate,MutableCalc,MutableCollect,MutableCorrelate,MutableExchange,MutableFilter,MutableJoin,MutableMatch,MutableProject,MutableSample,MutableScan,MutableSetOp,MutableSort,MutableTableFunctionScan,MutableTableModify,MutableUncollect,MutableValues,MutableWindow
Mutable equivalent of
RelNode.
Each node has mutable state, and keeps track of its parent and position
within parent.
It doesn't make sense to canonize MutableRels,
otherwise one node could end up with multiple parents.
It follows that #hashCode and #equals are less efficient
than their RelNode counterparts.
But, you don't need to copy a MutableRel in order to change it.
For this reason, you should use MutableRel for short-lived
operations, and transcribe back to RelNode when you are done.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal RelOptClusterprotected intprotected static final com.google.common.base.Equivalence<List<?>>Equivalence that comparesListss by theObject.toString()of their elements.protected @Nullable MutableRelfinal RelDataTypeprotected static final com.google.common.base.Equivalence<Object>Equivalence that compares objects by theirObject.toString()method.protected final org.apache.calcite.rel.mutable.MutableRelType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMutableRel(RelOptCluster cluster, RelDataType rowType, org.apache.calcite.rel.mutable.MutableRelType type) -
Method Summary
Modifier and TypeMethodDescriptionabstract voidchildrenAccept(MutableRelVisitor visitor) abstract MutableRelclone()final Stringdeep()abstract StringBuilderdigest(StringBuilder buf) abstract List<MutableRel>@Nullable MutableRel@Nullable MutableRelreplaceInParent(MutableRel child) Replaces thisMutableRelin its parent with another node at the same position.abstract voidsetInput(int ordinalInParent, MutableRel input) final StringtoString()
-
Field Details
-
STRING_EQUIVALENCE
Equivalence that compares objects by theirObject.toString()method. -
PAIRWISE_STRING_EQUIVALENCE
Equivalence that comparesListss by theObject.toString()of their elements. -
cluster
-
rowType
-
type
protected final org.apache.calcite.rel.mutable.MutableRelType type -
parent
-
ordinalInParent
protected int ordinalInParent
-
-
Constructor Details
-
MutableRel
protected MutableRel(RelOptCluster cluster, RelDataType rowType, org.apache.calcite.rel.mutable.MutableRelType type)
-
-
Method Details
-
getParent
-
setInput
-
getInputs
-
clone
-
childrenAccept
-
replaceInParent
Replaces thisMutableRelin its parent with another node at the same position.Before the method,
childmust be an orphan (have null parent) and after this method, thisMutableRelis an orphan.- Returns:
- The parent
-
digest
-
deep
-
toString
-