Package org.apache.calcite.rel
Class RelDistributionTraitDef
- java.lang.Object
-
- org.apache.calcite.plan.RelTraitDef<RelDistribution>
-
- org.apache.calcite.rel.RelDistributionTraitDef
-
public class RelDistributionTraitDef extends RelTraitDef<RelDistribution>
Definition of the distribution trait.Distribution is a physical property (i.e. a trait) because it can be changed without loss of information. The converter to do this is the
Exchange
operator.
-
-
Field Summary
Fields Modifier and Type Field Description static RelDistributionTraitDef
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
RelDistributionTraitDef()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(RelOptPlanner planner, RelDistribution fromTrait, RelDistribution toTrait)
Tests whether the given RelTrait can be converted to another RelTrait.RelNode
convert(RelOptPlanner planner, RelNode rel, RelDistribution toDistribution, boolean allowInfiniteCostConverters)
Converts the given RelNode to the given RelTrait.RelDistribution
getDefault()
Returns the default member of this trait.java.lang.String
getSimpleName()
java.lang.Class<RelDistribution>
getTraitClass()
-
Methods inherited from class org.apache.calcite.plan.RelTraitDef
canConvert, canonize, deregisterConverterRule, multiple, registerConverterRule
-
-
-
-
Field Detail
-
INSTANCE
public static final RelDistributionTraitDef INSTANCE
-
-
Method Detail
-
getTraitClass
public java.lang.Class<RelDistribution> getTraitClass()
- Specified by:
getTraitClass
in classRelTraitDef<RelDistribution>
- Returns:
- the specific RelTrait type associated with this RelTraitDef.
-
getSimpleName
public java.lang.String getSimpleName()
- Specified by:
getSimpleName
in classRelTraitDef<RelDistribution>
- Returns:
- a simple name for this RelTraitDef (for use in
RelNode.explain(org.apache.calcite.rel.RelWriter)
).
-
getDefault
public RelDistribution getDefault()
Description copied from class:RelTraitDef
Returns the default member of this trait.- Specified by:
getDefault
in classRelTraitDef<RelDistribution>
-
convert
public RelNode convert(RelOptPlanner planner, RelNode rel, RelDistribution toDistribution, boolean allowInfiniteCostConverters)
Description copied from class:RelTraitDef
Converts the given RelNode to the given RelTrait.- Specified by:
convert
in classRelTraitDef<RelDistribution>
- Parameters:
planner
- the planner requesting the conversionrel
- RelNode to converttoDistribution
- 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, RelDistribution fromTrait, RelDistribution toTrait)
Description copied from class:RelTraitDef
Tests whether the given RelTrait can be converted to another RelTrait.- Specified by:
canConvert
in classRelTraitDef<RelDistribution>
- Parameters:
planner
- the planner requesting the conversion testfromTrait
- the RelTrait to convert fromtoTrait
- the RelTrait to convert to- Returns:
- true if fromTrait can be converted to toTrait
-
-