Package org.apache.calcite.plan
Class ConventionTraitDef
Definition of the convention trait.
A new set of conversion information is created for
each planner that registers at least one
ConverterRule instance.
Conversion data is held in a LoadingCache
with weak keys so that the JVM's garbage
collector may reclaim the conversion data after the planner itself has been
garbage collected. The conversion information consists of a graph of
conversions (from one calling convention to another) and a map of graph arcs
to ConverterRules.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(RelOptPlanner planner, Convention fromConvention, Convention toConvention) Tests whether the given RelTrait can be converted to another RelTrait.@Nullable RelNodeconvert(RelOptPlanner planner, RelNode rel, Convention toConvention, boolean allowInfiniteCostConverters) Converts the given RelNode to the given RelTrait.voidderegisterConverterRule(RelOptPlanner planner, ConverterRule converterRule) Provides notification that a particularConverterRulehas been de-registered from aRelOptPlanner.Returns the default member of this trait.Returns a simple name for this RelTraitDef (for use inRelNode.explain(org.apache.calcite.rel.RelWriter)).Returns the specific RelTrait type associated with this RelTraitDef.voidregisterConverterRule(RelOptPlanner planner, ConverterRule converterRule) Provides notification of the registration of a particularConverterRulewith aRelOptPlanner.Methods inherited from class org.apache.calcite.plan.RelTraitDef
canonize, multiple
-
Field Details
-
INSTANCE
-
-
Method Details
-
getTraitClass
Description copied from class:RelTraitDefReturns the specific RelTrait type associated with this RelTraitDef.- Specified by:
getTraitClassin classRelTraitDef<Convention>
-
getSimpleName
Description copied from class:RelTraitDefReturns a simple name for this RelTraitDef (for use inRelNode.explain(org.apache.calcite.rel.RelWriter)).- Specified by:
getSimpleNamein classRelTraitDef<Convention>
-
getDefault
Description copied from class:RelTraitDefReturns the default member of this trait.- Specified by:
getDefaultin classRelTraitDef<Convention>
-
registerConverterRule
Description copied from class:RelTraitDefProvides notification of the registration of a particularConverterRulewith aRelOptPlanner. The default implementation does nothing.- Overrides:
registerConverterRulein classRelTraitDef<Convention>- Parameters:
planner- the planner registering the ruleconverterRule- the registered converter rule
-
deregisterConverterRule
Description copied from class:RelTraitDefProvides notification that a particularConverterRulehas been de-registered from aRelOptPlanner. The default implementation does nothing.- Overrides:
deregisterConverterRulein classRelTraitDef<Convention>- Parameters:
planner- the planner registering the ruleconverterRule- the registered converter rule
-
convert
public @Nullable RelNode convert(RelOptPlanner planner, RelNode rel, Convention toConvention, boolean allowInfiniteCostConverters) Description copied from class:RelTraitDefConverts the given RelNode to the given RelTrait.- Specified by:
convertin classRelTraitDef<Convention>- Parameters:
planner- the planner requesting the conversionrel- RelNode to converttoConvention- RelTrait to convert toallowInfiniteCostConverters- flag indicating whether infinite cost converters are allowed- Returns:
- a converted RelNode or null if conversion is not possible
-
canConvert
public boolean canConvert(RelOptPlanner planner, Convention fromConvention, Convention toConvention) Description copied from class:RelTraitDefTests whether the given RelTrait can be converted to another RelTrait.- Specified by:
canConvertin classRelTraitDef<Convention>- Parameters:
planner- the planner requesting the conversion testfromConvention- the RelTrait to convert fromtoConvention- the RelTrait to convert to- Returns:
- true if fromTrait can be converted to toTrait
-