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
Modifier and TypeFieldDescriptionstatic final RelCollation
Deprecated.static final RelCollation
Deprecated. -
Constructor Summary
ModifierConstructorDescriptionprotected
RelCollationImpl
(com.google.common.collect.ImmutableList<RelFieldCollation> fieldCollations) -
Method Summary
Modifier and TypeMethodDescriptionapply
(Mappings.TargetMapping mapping) Applies mapping to a given collation.int
static List<RelCollation>
createSingleton
(int fieldIndex) Deprecated.static boolean
equal
(List<RelCollation> collationList1, List<RelCollation> collationList2) Deprecated.boolean
Returns the ordinals and directions of the columns in this ordering.Returns the RelTraitDef that defines this RelTrait.int
hashCode()
boolean
isTop()
Returns whether this trait is satisfied by every instance of the trait (including itself).static boolean
isValid
(RelDataType rowType, List<RelCollation> collationList, boolean fail) Deprecated.static RelCollation
of
(List<RelFieldCollation> fieldCollations) Deprecated.static RelCollation
of
(RelFieldCollation... fieldCollations) Deprecated.ordinals
(RelCollation collation) Deprecated.void
register
(RelOptPlanner planner) Registers a trait instance with the planner.boolean
Returns 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, wait
Methods 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:RelTrait
Returns the RelTraitDef that defines this RelTrait.- Specified by:
getTraitDef
in interfaceRelTrait
- Returns:
- the RelTraitDef that defines this RelTrait
-
getFieldCollations
Description copied from interface:RelCollation
Returns the ordinals and directions of the columns in this ordering.- Specified by:
getFieldCollations
in interfaceRelCollation
-
hashCode
public int hashCode()Description copied from interface:RelTrait
-
equals
Description copied from interface:RelTrait
-
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
- Specified by:
compareTo
in interfaceComparable<RelMultipleTrait>
-
register
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.
-
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: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. -
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.
-