public class RelCollationTraitDef extends RelTraitDef<RelCollation>
Ordering is a physical property (i.e. a trait) because it can be changed
without loss of information. The converter to do this is the
Sort operator.
Unlike other current traits, a RelNode can have more than one
value of this trait simultaneously. For example,
LogicalTableScan(table=TIME_BY_DAY) might be sorted by
{the_year, the_month, the_date} and also by
{time_id}. We have to allow a RelNode to belong to more than
one RelSubset (these RelSubsets are always in the same set).
| Modifier and Type | Field and Description |
|---|---|
static RelCollationTraitDef |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(RelOptPlanner planner,
RelCollation fromTrait,
RelCollation toTrait)
Tests whether the given RelTrait can be converted to another RelTrait.
|
@Nullable RelNode |
convert(RelOptPlanner planner,
RelNode rel,
RelCollation toCollation,
boolean allowInfiniteCostConverters)
Converts the given RelNode to the given RelTrait.
|
RelCollation |
getDefault()
Returns the default member of this trait.
|
String |
getSimpleName()
Returns a simple name for this RelTraitDef (for use in
RelNode.explain(org.apache.calcite.rel.RelWriter)). |
Class<RelCollation> |
getTraitClass()
Returns the specific RelTrait type associated with this RelTraitDef.
|
boolean |
multiple()
Whether a relational expression may possess more than one instance of
this trait simultaneously.
|
canonize, deregisterConverterRule, registerConverterRulepublic static final RelCollationTraitDef INSTANCE
public Class<RelCollation> getTraitClass()
RelTraitDefgetTraitClass in class RelTraitDef<RelCollation>public String getSimpleName()
RelTraitDefRelNode.explain(org.apache.calcite.rel.RelWriter)).getSimpleName in class RelTraitDef<RelCollation>public boolean multiple()
RelTraitDefA subset has only one instance of a trait.
multiple in class RelTraitDef<RelCollation>public RelCollation getDefault()
RelTraitDefgetDefault in class RelTraitDef<RelCollation>public @Nullable RelNode convert(RelOptPlanner planner, RelNode rel, RelCollation toCollation, boolean allowInfiniteCostConverters)
RelTraitDefconvert in class RelTraitDef<RelCollation>planner - the planner requesting the conversionrel - RelNode to converttoCollation - RelTrait to convert toallowInfiniteCostConverters - flag indicating whether infinite cost
converters are allowedpublic boolean canConvert(RelOptPlanner planner, RelCollation fromTrait, RelCollation toTrait)
RelTraitDefcanConvert in class RelTraitDef<RelCollation>planner - the planner requesting the conversion testfromTrait - the RelTrait to convert fromtoTrait - the RelTrait to convert toCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.