Package org.apache.calcite.plan
Interface Convention
- All Superinterfaces:
RelTrait
- All Known Implementing Classes:
BindableConvention
,Convention.Impl
,EnumerableConvention
,InterpretableConvention
,JdbcConvention
public interface Convention extends RelTrait
Calling convention trait.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Convention.Impl
Default implementation. -
Field Summary
Fields Modifier and Type Field Description static Convention
NONE
Convention that for a relational expression that does not support any convention. -
Method Summary
Modifier and Type Method Description default boolean
canConvertConvention(Convention toConvention)
Returns whether we should convert from this convention totoConvention
.default RelNode
enforce(RelNode input, RelTraitSet required)
Given an input and required traits, returns the corresponding enforcer rel nodes, like physical Sort, Exchange etc.Class
getInterface()
String
getName()
default RelFactories.Struct
getRelFactories()
Return RelFactories struct for this convention.default boolean
useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits)
Returns whether we should convert from this trait set to the other trait set.
-
Field Details
-
NONE
Convention that for a relational expression that does not support any convention. It is not implementable, and has to be transformed to something else in order to be implemented.Relational expressions generally start off in this form.
Such expressions always have infinite cost.
-
-
Method Details
-
getInterface
Class getInterface() -
getName
String getName() -
enforce
Given an input and required traits, returns the corresponding enforcer rel nodes, like physical Sort, Exchange etc.- Parameters:
input
- The input RelNoderequired
- The required traits- Returns:
- Physical enforcer that satisfies the required traitSet,
or
null
if trait enforcement is not allowed or the required traitSet can't be satisfied.
-
canConvertConvention
Returns whether we should convert from this convention totoConvention
. Used byConventionTraitDef
.- Parameters:
toConvention
- Desired convention to convert to- Returns:
- Whether we should convert from this convention to toConvention
-
useAbstractConvertersForConversion
Returns 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.
- Parameters:
fromTraits
- Traits of the RelNode that we are converting fromtoTraits
- Target traits- Returns:
- Whether we should add converters
-
getRelFactories
Return RelFactories struct for this convention. It can can be used to build RelNode.
-