public static class Convention.Impl extends java.lang.Object implements Convention
Convention.Impl
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
name |
private java.lang.Class<? extends RelNode> |
relClass |
NONE
Constructor and Description |
---|
Impl(java.lang.String name,
java.lang.Class<? extends RelNode> relClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertConvention(Convention toConvention)
Returns whether we should convert from this convention to
toConvention . |
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.
|
private final java.lang.String name
private final java.lang.Class<? extends RelNode> relClass
public Impl(java.lang.String name, java.lang.Class<? extends RelNode> relClass)
public java.lang.String toString()
RelTrait
public void register(RelOptPlanner planner)
RelTrait
This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
public boolean satisfies(RelTrait trait)
RelTrait
A trait satisfies another if it is the same or stricter. For example,
ORDER BY x, y
satisfies ORDER BY x
.
A trait's satisfies
relation must be a partial order (reflexive,
anti-symmetric, transitive). Many traits cannot be "loosened"; their
satisfies
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.
public java.lang.Class getInterface()
getInterface
in interface Convention
public java.lang.String getName()
getName
in interface Convention
public RelTraitDef getTraitDef()
RelTrait
getTraitDef
in interface RelTrait
public boolean canConvertConvention(Convention toConvention)
Convention
toConvention
. Used by ConventionTraitDef
.canConvertConvention
in interface Convention
toConvention
- Desired convention to convert topublic boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits)
Convention
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.
useAbstractConvertersForConversion
in interface Convention
fromTraits
- Traits of the RelNode that we are converting fromtoTraits
- Target traitsCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.