Enum EnumerableConvention
- java.lang.Object
-
- java.lang.Enum<EnumerableConvention>
-
- org.apache.calcite.adapter.enumerable.EnumerableConvention
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<EnumerableConvention>
,Convention
,RelTrait
public enum EnumerableConvention extends java.lang.Enum<EnumerableConvention> implements Convention
Family of calling conventions that return results as anEnumerable
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.plan.Convention
Convention.Impl
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description static double
COST_MULTIPLIER
Cost of an enumerable node versus implementing an equivalent node in a "typical" calling convention.-
Fields inherited from interface org.apache.calcite.plan.Convention
NONE
-
-
Constructor Summary
Constructors Modifier Constructor Description private
EnumerableConvention()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvertConvention(Convention toConvention)
Returns whether we should convert from this convention totoConvention
.java.lang.Class
getInterface()
java.lang.String
getName()
RelTraitDef
getTraitDef()
Returns the RelTraitDef that defines this RelTrait.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.boolean
useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits)
Returns whether we should convert from this trait set to the other trait set.static EnumerableConvention
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EnumerableConvention[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final EnumerableConvention INSTANCE
-
-
Field Detail
-
COST_MULTIPLIER
public static final double COST_MULTIPLIER
Cost of an enumerable node versus implementing an equivalent node in a "typical" calling convention.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static EnumerableConvention[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EnumerableConvention c : EnumerableConvention.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EnumerableConvention valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
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.- Specified by:
toString
in interfaceRelTrait
- Overrides:
toString
in classjava.lang.Enum<EnumerableConvention>
-
getInterface
public java.lang.Class getInterface()
- Specified by:
getInterface
in interfaceConvention
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceConvention
-
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
-
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.
-
canConvertConvention
public boolean canConvertConvention(Convention toConvention)
Description copied from interface:Convention
Returns whether we should convert from this convention totoConvention
. Used byConventionTraitDef
.- Specified by:
canConvertConvention
in interfaceConvention
- Parameters:
toConvention
- Desired convention to convert to- Returns:
- Whether we should convert from this convention to toConvention
-
useAbstractConvertersForConversion
public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits)
Description copied from interface:Convention
Returns whether we should convert from this trait set to the other trait set.The convention decides whether it wants to handle other trait conversions, e.g. collation, distribution, etc. For a given convention, we will only add abstract converters to handle the trait (convention, collation, distribution, etc.) conversions if this function returns true.
- Specified by:
useAbstractConvertersForConversion
in interfaceConvention
- Parameters:
fromTraits
- Traits of the RelNode that we are converting fromtoTraits
- Target traits- Returns:
- Whether we should add converters
-
-