Class Convention.Impl
- All Implemented Interfaces:
Convention,RelTrait
- Direct Known Subclasses:
JdbcConvention
- Enclosing interface:
Convention
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.plan.Convention
Convention.Impl -
Field Summary
Fields inherited from interface org.apache.calcite.plan.Convention
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvertConvention(Convention toConvention) Returns whether we should convert from this convention totoConvention.@Nullable RelNodeenforce(RelNode input, RelTraitSet required) Given an input and required traits, returns the corresponding enforcer rel nodes, like physical Sort, Exchange etc.getName()Returns the RelTraitDef that defines this RelTrait.voidregister(RelOptPlanner planner) Registers a trait instance with the planner.booleanReturns whether this trait satisfies a given trait.toString()Returns a succinct name for this trait.booleanuseAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits) Returns whether we should convert from this trait set to the other trait set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.plan.Convention
getRelFactories
-
Constructor Details
-
Impl
-
-
Method Details
-
toString
Description copied from interface:RelTraitReturns a succinct name for this trait. The planner may use this String to describe the trait. -
register
Description copied from interface:RelTraitRegisters a trait instance with the planner.This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
-
satisfies
Description copied from interface:RelTraitReturns whether this trait satisfies a given trait.A trait satisfies another if it is the same or stricter. For example,
ORDER BY x, ysatisfiesORDER BY x.A trait's
satisfiesrelation must be a partial order (reflexive, anti-symmetric, transitive). Many traits cannot be "loosened"; theirsatisfiesis an equivalence relation, where only X satisfies X.If a trait has multiple values (see
RelCompositeTrait) a collection (T0, T1, ...) satisfies T if any Ti satisfies T. -
getInterface
- Specified by:
getInterfacein interfaceConvention
-
getName
- Specified by:
getNamein interfaceConvention
-
getTraitDef
Description copied from interface:RelTraitReturns the RelTraitDef that defines this RelTrait.- Specified by:
getTraitDefin interfaceRelTrait- Returns:
- the RelTraitDef that defines this RelTrait
-
enforce
Description copied from interface:ConventionGiven an input and required traits, returns the corresponding enforcer rel nodes, like physical Sort, Exchange etc.- Specified by:
enforcein interfaceConvention- Parameters:
input- The input RelNoderequired- The required traits- Returns:
- Physical enforcer that satisfies the required traitSet,
or
nullif trait enforcement is not allowed or the required traitSet can't be satisfied.
-
canConvertConvention
Description copied from interface:ConventionReturns whether we should convert from this convention totoConvention. Used byConventionTraitDef.- Specified by:
canConvertConventionin interfaceConvention- Parameters:
toConvention- Desired convention to convert to- Returns:
- Whether we should convert from this convention to toConvention
-
useAbstractConvertersForConversion
Description copied from interface:ConventionReturns whether we should convert from this trait set to the other trait set.The convention decides whether it wants to handle other trait conversions, e.g. collation, distribution, etc. For a given convention, we will only add abstract converters to handle the trait (convention, collation, distribution, etc.) conversions if this function returns true.
- Specified by:
useAbstractConvertersForConversionin interfaceConvention- Parameters:
fromTraits- Traits of the RelNode that we are converting fromtoTraits- Target traits- Returns:
- Whether we should add converters
-