Package org.apache.calcite.rel
Class RelCollationImpl
- java.lang.Object
-
- org.apache.calcite.rel.RelCollationImpl
-
- All Implemented Interfaces:
java.lang.Comparable<RelMultipleTrait>
,RelMultipleTrait
,RelTrait
,RelCollation
public class RelCollationImpl extends java.lang.Object implements RelCollation
Simple implementation ofRelCollation
.
-
-
Field Summary
Fields Modifier and Type Field Description static RelCollation
EMPTY
Deprecated.private com.google.common.collect.ImmutableList<RelFieldCollation>
fieldCollations
static RelCollation
PRESERVE
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RelCollationImpl(com.google.common.collect.ImmutableList<RelFieldCollation> fieldCollations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(RelMultipleTrait o)
static java.util.List<RelCollation>
createSingleton(int fieldIndex)
Deprecated.static boolean
equal(java.util.List<RelCollation> collationList1, java.util.List<RelCollation> collationList2)
Deprecated.boolean
equals(java.lang.Object obj)
java.util.List<RelFieldCollation>
getFieldCollations()
Returns the ordinals and directions of the columns in this ordering.RelTraitDef
getTraitDef()
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, java.util.List<RelCollation> collationList, boolean fail)
Deprecated.static RelCollation
of(java.util.List<RelFieldCollation> fieldCollations)
Deprecated.static RelCollation
of(RelFieldCollation... fieldCollations)
Deprecated.static java.util.List<java.lang.Integer>
ordinals(RelCollation collation)
Deprecated.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 string representation of this collation, suitably terse given that it will appear in plan traces.
-
-
-
Field Detail
-
EMPTY
@Deprecated public static final RelCollation EMPTY
Deprecated.
-
PRESERVE
@Deprecated public static final RelCollation PRESERVE
Deprecated.
-
fieldCollations
private final com.google.common.collect.ImmutableList<RelFieldCollation> fieldCollations
-
-
Constructor Detail
-
RelCollationImpl
protected RelCollationImpl(com.google.common.collect.ImmutableList<RelFieldCollation> fieldCollations)
-
-
Method Detail
-
of
@Deprecated public static RelCollation of(RelFieldCollation... fieldCollations)
Deprecated.
-
of
@Deprecated public static RelCollation of(java.util.List<RelFieldCollation> fieldCollations)
Deprecated.
-
getTraitDef
public RelTraitDef 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
public java.util.List<RelFieldCollation> 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
public boolean equals(java.lang.Object obj)
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
public int compareTo(@Nonnull RelMultipleTrait o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<RelMultipleTrait>
-
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.
-
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.
-
toString
public java.lang.String 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 public static java.util.List<RelCollation> createSingleton(int fieldIndex)
Deprecated.
-
isValid
@Deprecated public static boolean isValid(RelDataType rowType, java.util.List<RelCollation> collationList, boolean fail)
Deprecated.
-
equal
@Deprecated public static boolean equal(java.util.List<RelCollation> collationList1, java.util.List<RelCollation> collationList2)
Deprecated.
-
ordinals
@Deprecated public static java.util.List<java.lang.Integer> ordinals(RelCollation collation)
Deprecated.
-
-