public class RelSubset extends AbstractRelNode
Physical properties are instances of the RelTraitSet, and consist
of traits such as calling convention and collation (sort-order).
For some traits, a relational expression can have more than one instance. For example, R can be sorted on both [X] and [Y, Z]. In which case, R would belong to the sub-sets for [X] and [Y, Z]; and also the leading edges [Y] and [].
RelNode.Contextdigest, id, rowType, traitSet| Modifier and Type | Method and Description |
|---|---|
void |
collectVariablesSet(Set<CorrelationId> variableSet)
Collects variables set by this expression.
|
void |
collectVariablesUsed(Set<CorrelationId> variableSet)
Collects variables known to be used by this expression or its
descendants.
|
@Nullable RelOptCost |
computeSelfCost(RelOptPlanner planner,
RelMetadataQuery mq)
Returns the cost of this plan (not including children).
|
boolean |
contains(RelNode node)
Returns whether this subset contains the specified relational expression.
|
RelNode |
copy(RelTraitSet traitSet,
List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and
inputs.
|
boolean |
deepEquals(@Nullable Object obj)
Equality check for RelNode digest.
|
int |
deepHashCode()
Compute hash code for RelNode digest.
|
protected RelDataType |
deriveRowType() |
double |
estimateRowCount(RelMetadataQuery mq)
Returns an estimate of the number of rows this relational expression will
return.
|
void |
explain(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
@Nullable RelNode |
getBest() |
RelNode |
getBestOrOriginal() |
String |
getDigest()
Returns a digest string of this
RelNode. |
@Nullable RelNode |
getOriginal() |
Collection<RelNode> |
getParentRels()
Returns a list of relational expressions one of whose children is this
subset.
|
List<RelNode> |
getRelList()
As
getRels() but returns a list. |
Iterable<RelNode> |
getRels()
Returns the rel nodes in this rel subset.
|
Stream<RelSubset> |
getSatisfyingSubsets()
Returns stream of subsets whose traitset is satisfied
by current subset's traitset.
|
Stream<RelSubset> |
getSubsetsSatisfyingThis()
Returns stream of subsets whose traitset satisfies
current subset's traitset.
|
@Nullable RelOptCost |
getWinnerCost()
Returns the best cost if this subset is fully optimized
or null if the subset is not fully optimized.
|
boolean |
isDelivered() |
boolean |
isRequired() |
accept, accept, childrenAccept, equals, explainTerms, getCluster, getConvention, getCorrelVariable, getDescription, getExpectedInputRowType, getId, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitexplain, fieldIsNullable@API(since="1.23",
status=EXPERIMENTAL)
public boolean isDelivered()
@API(since="1.23",
status=EXPERIMENTAL)
public boolean isRequired()
public @Nullable RelNode getBest()
public @Nullable RelNode getOriginal()
@API(since="1.27",
status=INTERNAL)
public RelNode getBestOrOriginal()
public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs)
RelNodeSub-classes with other important attributes are encouraged to create variants of this method with more parameters.
copy in interface RelNodecopy in class AbstractRelNodetraitSet - Trait setinputs - Inputspublic @Nullable RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode), which gives plugins a
chance to override the rel's default ideas about cost.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNodeplanner - Planner for cost calculationmq - Metadata querypublic double estimateRowCount(RelMetadataQuery mq)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode), which gives plugins a chance to
override the rel's default ideas about row count.
estimateRowCount in interface RelNodeestimateRowCount in class AbstractRelNodemq - Metadata querypublic void explain(RelWriter pw)
RelNodesuper.explain, then call the
RelWriter.input(String, RelNode)
and
RelWriter.item(String, Object)
methods for each input and attribute.explain in interface RelNodeexplain in class AbstractRelNodepw - Plan writerpublic boolean deepEquals(@Nullable Object obj)
AbstractRelNodeBy default this method collects digest attributes from
AbstractRelNode.explainTerms(RelWriter), then compares each attribute pair.
This should work well for most cases. If this method is a performance
bottleneck for your project, or the default behavior can't handle
your scenario properly, you can choose to override this method and
AbstractRelNode.deepHashCode(). See LogicalJoin as an example.
deepEquals in interface RelNodedeepEquals in class AbstractRelNodeAbstractRelNode.deepHashCode()public int deepHashCode()
AbstractRelNodedeepHashCode in interface RelNodedeepHashCode in class AbstractRelNodeRelNode.deepEquals(Object)protected RelDataType deriveRowType()
deriveRowType in class AbstractRelNodepublic Collection<RelNode> getParentRels()
public void collectVariablesUsed(Set<CorrelationId> variableSet)
RelNodecollectVariablesUsed in interface RelNodecollectVariablesUsed in class AbstractRelNodevariableSet - receives variables usedpublic void collectVariablesSet(Set<CorrelationId> variableSet)
RelNodecollectVariablesSet in interface RelNodecollectVariablesSet in class AbstractRelNodevariableSet - receives variables known to be set bypublic Iterable<RelNode> getRels()
public boolean contains(RelNode node)
@API(since="1.23",
status=EXPERIMENTAL)
public Stream<RelSubset> getSubsetsSatisfyingThis()
@API(since="1.23",
status=EXPERIMENTAL)
public Stream<RelSubset> getSatisfyingSubsets()
@API(since="1.24",
status=INTERNAL)
public @Nullable RelOptCost getWinnerCost()
public String getDigest()
RelNodeRelNode.
Each call creates a new digest string, so don't forget to cache the result if necessary.
getDigest in interface RelOptNodegetDigest in interface RelNodegetDigest in class AbstractRelNodeRelNodeRelNode.getRelDigest()Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.