public abstract class Sort extends SingleRel
RelNode.Context| Modifier and Type | Field and Description |
|---|---|
RelCollation |
collation |
RexNode |
fetch |
RexNode |
offset |
digest, id, rowType, traitSet| Constructor and Description |
|---|
Sort(RelInput input)
Creates a Sort by parsing serialized output.
|
Sort(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
RelCollation collation)
Creates a Sort.
|
Sort(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
RelCollation collation,
RexNode offset,
RexNode fetch)
Creates a Sort.
|
| Modifier and Type | Method and Description |
|---|---|
RelNode |
accept(RexShuttle shuttle)
Accepts a visit from a shuttle.
|
RelOptCost |
computeSelfCost(RelOptPlanner planner,
RelMetadataQuery mq)
Returns the cost of this plan (not including children).
|
Sort |
copy(RelTraitSet traitSet,
List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and
inputs.
|
Sort |
copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation) |
abstract Sort |
copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
RelCollation |
getCollation()
Returns the array of
RelFieldCollations asked for by the sort
specification, from most significant to least significant. |
List<RexNode> |
getSortExps()
Returns the sort expressions.
|
boolean |
isEnforcer()
Indicates whether it is an enforcer operator, e.g.
|
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInputaccept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isValid, metadata, onRegister, recomputeDigest, register, sole, toStringpublic final RelCollation collation
public final RexNode offset
public final RexNode fetch
public Sort(RelOptCluster cluster, RelTraitSet traits, RelNode child, RelCollation collation)
cluster - Cluster this relational expression belongs totraits - Traitschild - input relational expressioncollation - array of sort specificationspublic Sort(RelOptCluster cluster, RelTraitSet traits, RelNode child, RelCollation collation, RexNode offset, RexNode fetch)
cluster - Cluster this relational expression belongs totraits - Traitschild - input relational expressioncollation - array of sort specificationsoffset - Expression for number of rows to discard before returning
first rowfetch - Expression for number of rows to fetchpublic Sort(RelInput input)
public final Sort copy(RelTraitSet traitSet, List<RelNode> inputs)
RelNodeSub-classes with other important attributes are encouraged to create variants of this method with more parameters.
copy in interface RelNodecopy in class AbstractRelNodetraitSet - Trait setinputs - Inputspublic final Sort copy(RelTraitSet traitSet, RelNode newInput, RelCollation newCollation)
public abstract Sort copy(RelTraitSet traitSet, RelNode newInput, RelCollation newCollation, RexNode offset, RexNode fetch)
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode), which gives plugins a
chance to override the rel's default ideas about cost.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNodeplanner - Planner for cost calculationmq - Metadata querypublic RelNode accept(RexShuttle shuttle)
RelNodeaccept in interface RelNodeaccept in class AbstractRelNodeshuttle - Shuttlepublic boolean isEnforcer()
RelNodeisEnforcer in interface RelNodeisEnforcer in class AbstractRelNodepublic RelCollation getCollation()
RelFieldCollations asked for by the sort
specification, from most significant to least significant.
See also RelMetadataQuery.collations(RelNode),
which lists all known collations. For example,
ORDER BY time_id might also be sorted by
the_year, the_month because of a known monotonicity
constraint among the columns. getCollation would return
[time_id] and collations would return
[ [time_id], [the_year, the_month] ].
public RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriter.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writerCopyright © 2012-2020 Apache Software Foundation. All Rights Reserved.