Package org.apache.calcite.rel
Class RelDistributions.RelDistributionImpl
- java.lang.Object
-
- org.apache.calcite.rel.RelDistributions.RelDistributionImpl
-
- All Implemented Interfaces:
java.lang.Comparable<RelMultipleTrait>
,RelMultipleTrait
,RelTrait
,RelDistribution
- Enclosing class:
- RelDistributions
private static class RelDistributions.RelDistributionImpl extends java.lang.Object implements RelDistribution
Implementation ofRelDistribution
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelDistribution
RelDistribution.Type
-
-
Field Summary
Fields Modifier and Type Field Description private ImmutableIntList
keys
private static com.google.common.collect.Ordering<java.lang.Iterable<java.lang.Integer>>
ORDERING
private RelDistribution.Type
type
-
Constructor Summary
Constructors Modifier Constructor Description private
RelDistributionImpl(RelDistribution.Type type, ImmutableIntList keys)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelDistribution
apply(Mappings.TargetMapping mapping)
int
compareTo(RelMultipleTrait o)
boolean
equals(java.lang.Object obj)
java.util.List<java.lang.Integer>
getKeys()
Returns the ordinals of the key columns.RelDistributionTraitDef
getTraitDef()
Returns the RelTraitDef that defines this RelTrait.RelDistribution.Type
getType()
Returns the type of distribution.int
hashCode()
boolean
isTop()
Returns whether this trait is satisfied by every instance of the trait (including itself).void
register(RelOptPlanner planner)
Registers a trait instance with the planner.boolean
satisfies(RelTrait trait)
Returns whether this trait satisfies a given trait.java.lang.String
toString()
Returns a succinct name for this trait.
-
-
-
Field Detail
-
ORDERING
private static final com.google.common.collect.Ordering<java.lang.Iterable<java.lang.Integer>> ORDERING
-
type
private final RelDistribution.Type type
-
keys
private final ImmutableIntList keys
-
-
Constructor Detail
-
RelDistributionImpl
private RelDistributionImpl(RelDistribution.Type type, ImmutableIntList keys)
-
-
Method Detail
-
hashCode
public int hashCode()
Description copied from interface:RelTrait
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:RelTrait
-
toString
public java.lang.String toString()
Description copied from interface:RelTrait
Returns a succinct name for this trait. The planner may use this String to describe the trait.
-
getType
@Nonnull public RelDistribution.Type getType()
Description copied from interface:RelDistribution
Returns the type of distribution.- Specified by:
getType
in interfaceRelDistribution
-
getKeys
@Nonnull public java.util.List<java.lang.Integer> getKeys()
Description copied from interface:RelDistribution
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.
- Specified by:
getKeys
in interfaceRelDistribution
-
getTraitDef
public RelDistributionTraitDef getTraitDef()
Description copied from interface:RelTrait
Returns the RelTraitDef that defines this RelTrait.- Specified by:
getTraitDef
in interfaceRelTrait
- Returns:
- the RelTraitDef that defines this RelTrait
-
apply
public RelDistribution apply(Mappings.TargetMapping mapping)
- Specified by:
apply
in interfaceRelDistribution
-
satisfies
public boolean satisfies(RelTrait trait)
Description copied from interface:RelTrait
Returns whether this trait satisfies a given trait.A trait satisfies another if it is the same or stricter. For example,
ORDER BY x, y
satisfiesORDER BY x
.A trait's
satisfies
relation must be a partial order (reflexive, anti-symmetric, transitive). Many traits cannot be "loosened"; theirsatisfies
is 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.
-
register
public void register(RelOptPlanner planner)
Description copied from interface:RelTrait
Registers a trait instance with the planner.This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
-
isTop
public boolean isTop()
Description copied from interface:RelMultipleTrait
Returns whether this trait is satisfied by every instance of the trait (including itself).- Specified by:
isTop
in interfaceRelMultipleTrait
-
compareTo
public int compareTo(@Nonnull RelMultipleTrait o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<RelMultipleTrait>
-
-