Package org.apache.calcite.rel
Class RelCollationImpl
java.lang.Object
org.apache.calcite.rel.RelCollationImpl
- All Implemented Interfaces:
Comparable<RelMultipleTrait>,RelMultipleTrait,RelTrait,RelCollation
Simple implementation of
RelCollation.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RelCollationDeprecated.static final RelCollationDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRelCollationImpl(com.google.common.collect.ImmutableList<RelFieldCollation> fieldCollations) -
Method Summary
Modifier and TypeMethodDescriptionapply(Mappings.TargetMapping mapping) Applies mapping to a given collation.intstatic List<RelCollation>createSingleton(int fieldIndex) Deprecated.static booleanequal(List<RelCollation> collationList1, List<RelCollation> collationList2) Deprecated.booleanReturns the ordinals and directions of the columns in this ordering.Returns the RelTraitDef that defines this RelTrait.inthashCode()booleanisTop()Returns whether this trait is satisfied by every instance of the trait (including itself).static booleanisValid(RelDataType rowType, List<RelCollation> collationList, boolean fail) Deprecated.static RelCollationof(List<RelFieldCollation> fieldCollations) Deprecated.static RelCollationof(RelFieldCollation... fieldCollations) Deprecated.ordinals(RelCollation collation) Deprecated.voidregister(RelOptPlanner planner) Registers a trait instance with the planner.booleanReturns whether this trait satisfies a given trait.toString()Returns a string representation of this collation, suitably terse given that it will appear in plan traces.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.RelCollation
getKeys
-
Field Details
-
EMPTY
Deprecated. -
PRESERVE
Deprecated.
-
-
Constructor Details
-
RelCollationImpl
protected RelCollationImpl(com.google.common.collect.ImmutableList<RelFieldCollation> fieldCollations)
-
-
Method Details
-
of
Deprecated. -
of
Deprecated. -
getTraitDef
Description copied from interface:RelTraitReturns the RelTraitDef that defines this RelTrait.- Specified by:
getTraitDefin interfaceRelTrait- Returns:
- the RelTraitDef that defines this RelTrait
-
getFieldCollations
Description copied from interface:RelCollationReturns the ordinals and directions of the columns in this ordering.- Specified by:
getFieldCollationsin interfaceRelCollation
-
hashCode
public int hashCode()Description copied from interface:RelTrait -
equals
Description copied from interface:RelTrait -
isTop
public boolean isTop()Description copied from interface:RelMultipleTraitReturns whether this trait is satisfied by every instance of the trait (including itself).- Specified by:
isTopin interfaceRelMultipleTrait
-
compareTo
- Specified by:
compareToin interfaceComparable<RelMultipleTrait>
-
register
Description copied from interface:RelTraitRegisters a trait instance with the planner.This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
-
apply
Applies mapping to a given collation.If mapping destroys the collation prefix, this method returns an empty collation. Examples of applying mappings to collation [0, 1]:
- mapping(0, 1) => [0, 1]
- mapping(1, 0) => [1, 0]
- mapping(0) => [0]
- mapping(1) => []
- mapping(2, 0) => [1]
- mapping(2, 1, 0) => [2, 1]
- mapping(2, 1) => []
-
satisfies
Description copied from interface:RelTraitReturns whether this trait satisfies a given trait.A trait satisfies another if it is the same or stricter. For example,
ORDER BY x, ysatisfiesORDER BY x.A trait's
satisfiesrelation must be a partial order (reflexive, anti-symmetric, transitive). Many traits cannot be "loosened"; theirsatisfiesis 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. -
toString
Returns a string representation of this collation, suitably terse given that it will appear in plan traces. Examples: "[]", "[2]", "[0 DESC, 1]", "[0 DESC, 1 ASC NULLS LAST]". -
createSingleton
Deprecated. -
isValid
@Deprecated public static boolean isValid(RelDataType rowType, List<RelCollation> collationList, boolean fail) Deprecated. -
equal
@Deprecated public static boolean equal(List<RelCollation> collationList1, List<RelCollation> collationList2) Deprecated. -
ordinals
Deprecated.
-