public interface PhysicalNode extends RelNode
How to use?
VolcanoPlanner.setTopDownOpt(boolean).
PhysicalNode,
see EnumerableRel as
an example.passThrough(RelTraitSet) or
passThroughTraits(RelTraitSet) depending on
your needs.getDeriveMode().DeriveMode.OMAKASE, override
method derive(List) in the physical operator,
otherwise, override derive(RelTraitSet, int)
or deriveTraits(RelTraitSet, int).RelNode.isEnforcer(),
see Sort.isEnforcer() as an example. This is important,
because it can help VolcanoPlanner avoid unnecessary
trait propagation and derivation, therefore improve optimization
efficiency.Convention.enforce(RelNode, RelTraitSet)
in your convention, which generates appropriate physical enforcer.
See EnumerableConvention
as example. Simply return null if you don't want physical
trait enforcement.RelNode.Context| Modifier and Type | Method and Description |
|---|---|
default List<RelNode> |
derive(List<List<RelTraitSet>> inputTraits)
Given a list of child traitsets,
inputTraits.size() == getInput().size(),
returns node list after traits derivation.
|
default @Nullable RelNode |
derive(RelTraitSet childTraits,
int childId)
Derive traitset from child node, returns new node after
traits derivation.
|
default @Nullable Pair<RelTraitSet,List<RelTraitSet>> |
deriveTraits(RelTraitSet childTraits,
int childId)
Derive traitset from child node, returns a pair of traits after
traits derivation.
|
default DeriveMode |
getDeriveMode()
Returns mode of derivation.
|
default @Nullable RelNode |
passThrough(RelTraitSet required)
Pass required traitset from parent node to child nodes,
returns new node after traits is passed down.
|
default @Nullable Pair<RelTraitSet,List<RelTraitSet>> |
passThroughTraits(RelTraitSet required)
Pass required traitset from parent node to child nodes,
returns a pair of traits after traits is passed down.
|
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, copy, deepEquals, deepHashCode, estimateRowCount, explain, explain, fieldIsNullable, getConvention, getCorrelVariable, getDigest, getExpectedInputRowType, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTable, getVariablesSet, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInputgetCluster, getDescription, getId, getTraitSetdefault @Nullable RelNode passThrough(RelTraitSet required)
default @Nullable Pair<RelTraitSet,List<RelTraitSet>> passThroughTraits(RelTraitSet required)
Pair.left: the new traitset
Pair.right: the list of required traitsets for child nodes
default @Nullable RelNode derive(RelTraitSet childTraits, int childId)
default @Nullable Pair<RelTraitSet,List<RelTraitSet>> deriveTraits(RelTraitSet childTraits, int childId)
Pair.left: the new traitset
Pair.right: the list of required traitsets for child nodes
default List<RelNode> derive(List<List<RelTraitSet>> inputTraits)
default DeriveMode getDeriveMode()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.