Package org.apache.calcite.rel
Interface RelDistribution
- All Superinterfaces:
Comparable<RelMultipleTrait>
,RelMultipleTrait
,RelTrait
public interface RelDistribution extends RelMultipleTrait
Description of the physical distribution of a relational expression.
TBD:
- Can we shorten
RelDistribution.Type.HASH_DISTRIBUTED
to HASH, etc. - Do we need
RelDistributions
.DEFAULT? RelDistributionTraitDef.convert(org.apache.calcite.plan.RelOptPlanner, org.apache.calcite.rel.RelNode, org.apache.calcite.rel.RelDistribution, boolean)
does not create specific physical operators as it does in Drill. Drill will need to create rules; or we could allow "converters" to be registered with the planner that are not trait-defs.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RelDistribution.Type
Type of distribution. -
Method Summary
Modifier and Type Method Description RelDistribution
apply(Mappings.TargetMapping mapping)
Applies mapping to this distribution trait.List<Integer>
getKeys()
Returns the ordinals of the key columns.RelDistribution.Type
getType()
Returns the type of distribution.
-
Method Details
-
getType
Returns the type of distribution. -
getKeys
Returns the ordinals of the key columns.Order is important for some types (RANGE); other types (HASH) consider it unimportant but impose an arbitrary order; other types (BROADCAST, SINGLETON) never have keys.
-
apply
Applies mapping to this distribution trait.Mapping can change the distribution trait only if it depends on distribution keys.
For example if relation is HASH distributed by keys [0, 1], after applying a mapping (3, 2, 1, 0), the relation will have a distribution HASH(2,3) because distribution keys changed their ordinals.
If mapping eliminates one of the distribution keys, the
RelDistribution.Type.ANY
distribution will be returned.If distribution doesn't have keys (BROADCAST or SINGLETON), method will return the same distribution.
-