public abstract class MutableRel extends Object
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.
| Modifier and Type | Field and Description |
|---|---|
RelOptCluster |
cluster |
protected int |
ordinalInParent |
protected static com.google.common.base.Equivalence<List<?>> |
PAIRWISE_STRING_EQUIVALENCE
Equivalence that compares
Listss by the
Object.toString() of their elements. |
protected @Nullable MutableRel |
parent |
RelDataType |
rowType |
protected static com.google.common.base.Equivalence<Object> |
STRING_EQUIVALENCE
Equivalence that compares objects by their
Object.toString()
method. |
protected org.apache.calcite.rel.mutable.MutableRelType |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
MutableRel(RelOptCluster cluster,
RelDataType rowType,
org.apache.calcite.rel.mutable.MutableRelType type) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
childrenAccept(MutableRelVisitor visitor) |
abstract MutableRel |
clone() |
String |
deep() |
abstract StringBuilder |
digest(StringBuilder buf) |
abstract List<MutableRel> |
getInputs() |
@Nullable MutableRel |
getParent() |
@Nullable MutableRel |
replaceInParent(MutableRel child)
Replaces this
MutableRel in its parent with another node at the
same position. |
abstract void |
setInput(int ordinalInParent,
MutableRel input) |
String |
toString() |
protected static final com.google.common.base.Equivalence<Object> STRING_EQUIVALENCE
Object.toString()
method.protected static final com.google.common.base.Equivalence<List<?>> PAIRWISE_STRING_EQUIVALENCE
Listss by the
Object.toString() of their elements.public final RelOptCluster cluster
public final RelDataType rowType
protected final org.apache.calcite.rel.mutable.MutableRelType type
protected @Nullable MutableRel parent
protected int ordinalInParent
protected MutableRel(RelOptCluster cluster, RelDataType rowType, org.apache.calcite.rel.mutable.MutableRelType type)
public @Nullable MutableRel getParent()
public abstract void setInput(int ordinalInParent,
MutableRel input)
public abstract List<MutableRel> getInputs()
public abstract MutableRel clone()
public abstract void childrenAccept(MutableRelVisitor visitor)
public @Nullable MutableRel replaceInParent(MutableRel child)
MutableRel 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, this MutableRel is an orphan.
public abstract StringBuilder digest(StringBuilder buf)
public final String deep()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.