public static class Convention.Impl extends Object implements Convention
Convention.Impl| Modifier and Type | Field and Description |
|---|---|
private String |
name |
private Class<? extends RelNode> |
relClass |
NONE| Constructor and Description |
|---|
Impl(String name,
Class<? extends RelNode> relClass) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvertConvention(Convention toConvention)
Returns whether we should convert from this convention to
toConvention. |
Class |
getInterface() |
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.
|
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 String name
public String toString()
RelTraitpublic void register(RelOptPlanner planner)
RelTraitThis is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
public boolean satisfies(RelTrait trait)
RelTraitA 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 Class getInterface()
getInterface in interface Conventionpublic String getName()
getName in interface Conventionpublic RelTraitDef getTraitDef()
RelTraitgetTraitDef in interface RelTraitpublic boolean canConvertConvention(Convention toConvention)
ConventiontoConvention. Used by ConventionTraitDef.canConvertConvention in interface ConventiontoConvention - Desired convention to convert topublic boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits)
ConventionThe 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 ConventionfromTraits - Traits of the RelNode that we are converting fromtoTraits - Target traitsCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.