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
Modifier and TypeFieldDescriptionfinal RelOptCluster
protected int
protected static final com.google.common.base.Equivalence<List<?>>
Equivalence that comparesLists
s by theObject.toString()
of their elements.protected @Nullable MutableRel
final RelDataType
protected 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
ModifierConstructorDescriptionprotected
MutableRel
(RelOptCluster cluster, RelDataType rowType, org.apache.calcite.rel.mutable.MutableRelType type) -
Method Summary
Modifier and TypeMethodDescriptionabstract void
childrenAccept
(MutableRelVisitor visitor) abstract MutableRel
clone()
final String
deep()
abstract StringBuilder
digest
(StringBuilder buf) abstract List<MutableRel>
@Nullable MutableRel
@Nullable MutableRel
replaceInParent
(MutableRel child) Replaces thisMutableRel
in its parent with another node at the same position.abstract void
setInput
(int ordinalInParent, MutableRel input) final String
toString()
-
Field Details
-
STRING_EQUIVALENCE
Equivalence that compares objects by theirObject.toString()
method. -
PAIRWISE_STRING_EQUIVALENCE
Equivalence that comparesLists
s 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 thisMutableRel
in its parent with another node at the same position.Before the method,
child
must be an orphan (have null parent) and after this method, thisMutableRel
is an orphan.- Returns:
- The parent
-
digest
-
deep
-
toString
-