Class RelSubset
- All Implemented Interfaces:
Cloneable,RelOptNode,RelNode
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 [].
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context -
Field Summary
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectVariablesSet(Set<CorrelationId> variableSet) Collects variables set by this expression.voidcollectVariablesUsed(Set<CorrelationId> variableSet) Collects variables known to be used by this expression or its descendants.@Nullable RelOptCostcomputeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) Returns the cost of this plan (not including children).booleanReturns whether this subset contains the specified relational expression.copy(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.booleandeepEquals(@Nullable Object obj) Equality check for RelNode digest.intCompute hash code for RelNode digest.protected RelDataTypedoubleReturns an estimate of the number of rows this relational expression will return.voidDescribes the inputs and attributes of this relational expression.@Nullable RelNodegetBest()Returns a digest string of thisRelNode.@Nullable RelNodeReturns a list of relational expressions one of whose children is this subset.AsgetRels()but returns a list.getRels()Returns the rel nodes in this rel subset.Returns stream of subsets whose traitset is satisfied by current subset's traitset.Returns stream of subsets whose traitset satisfies current subset's traitset.@Nullable RelOptCostReturns the best cost if this subset is fully optimized or null if the subset is not fully optimized.booleanbooleanstripped()Returns this node without any wrapper added by the planner.Methods inherited from class org.apache.calcite.rel.AbstractRelNode
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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable
-
Method Details
-
isDelivered
@API(since="1.23", status=EXPERIMENTAL) public boolean isDelivered() -
isRequired
@API(since="1.23", status=EXPERIMENTAL) public boolean isRequired() -
getBest
-
getOriginal
-
getBestOrOriginal
-
stripped
Description copied from interface:RelNodeReturns this node without any wrapper added by the planner. -
copy
Description copied from interface:RelNodeCreates a copy of this relational expression, perhaps changing traits and inputs.Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
- Specified by:
copyin interfaceRelNode- Overrides:
copyin classAbstractRelNode- Parameters:
traitSet- Trait setinputs- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
computeSelfCost
Description copied from interface:RelNodeReturns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.NOTE 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.- Specified by:
computeSelfCostin interfaceRelNode- Overrides:
computeSelfCostin classAbstractRelNode- Parameters:
planner- Planner for cost calculationmq- Metadata query- Returns:
- Cost of this plan (not including children)
-
estimateRowCount
Description copied from interface:RelNodeReturns an estimate of the number of rows this relational expression will return.NOTE 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.- Specified by:
estimateRowCountin interfaceRelNode- Overrides:
estimateRowCountin classAbstractRelNode- Parameters:
mq- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
explain
Description copied from interface:RelNodeDescribes the inputs and attributes of this relational expression. Each node should callsuper.explain, then call theRelWriter.input(String, RelNode)andRelWriter.item(String, Object)methods for each input and attribute.- Specified by:
explainin interfaceRelNode- Overrides:
explainin classAbstractRelNode- Parameters:
pw- Plan writer
-
deepEquals
Description copied from class:AbstractRelNodeEquality check for RelNode digest.By 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 andAbstractRelNode.deepHashCode(). SeeLogicalJoinas an example.- Specified by:
deepEqualsin interfaceRelNode- Overrides:
deepEqualsin classAbstractRelNode- Returns:
- Whether the 2 RelNodes are equivalent or have the same digest.
- See Also:
-
deepHashCode
public int deepHashCode()Description copied from class:AbstractRelNodeCompute hash code for RelNode digest.- Specified by:
deepHashCodein interfaceRelNode- Overrides:
deepHashCodein classAbstractRelNode- See Also:
-
deriveRowType
- Overrides:
deriveRowTypein classAbstractRelNode
-
getParentRels
Returns a list of relational expressions one of whose children is this subset. The elements of the list are distinct. -
collectVariablesUsed
Description copied from interface:RelNodeCollects variables known to be used by this expression or its descendants. By default, no such information is available and must be derived by analyzing sub-expressions, but some optimizer implementations may insert special expressions which remember such information.- Specified by:
collectVariablesUsedin interfaceRelNode- Overrides:
collectVariablesUsedin classAbstractRelNode- Parameters:
variableSet- receives variables used
-
collectVariablesSet
Description copied from interface:RelNodeCollects variables set by this expression. TODO: is this required?- Specified by:
collectVariablesSetin interfaceRelNode- Overrides:
collectVariablesSetin classAbstractRelNode- Parameters:
variableSet- receives variables known to be set by
-
getRels
Returns the rel nodes in this rel subset. All rels must have the same traits and are logically equivalent.- Returns:
- all the rels in the subset
-
getRelList
AsgetRels()but returns a list. -
contains
Returns whether this subset contains the specified relational expression. -
getSubsetsSatisfyingThis
Returns stream of subsets whose traitset satisfies current subset's traitset. -
getSatisfyingSubsets
Returns stream of subsets whose traitset is satisfied by current subset's traitset. -
getWinnerCost
Returns the best cost if this subset is fully optimized or null if the subset is not fully optimized. -
getDigest
Description copied from interface:RelNodeReturns a digest string of thisRelNode.Each call creates a new digest string, so don't forget to cache the result if necessary.
- Specified by:
getDigestin interfaceRelNode- Specified by:
getDigestin interfaceRelOptNode- Overrides:
getDigestin classAbstractRelNode- Returns:
- Digest string of this
RelNode - See Also:
-