public abstract class Sort extends SingleRel
| Modifier and Type | Field and Description |
|---|---|
RelCollation |
collation |
RexNode |
fetch |
protected com.google.common.collect.ImmutableList<RexNode> |
fieldExps |
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)
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.
|
List<RexNode> |
getChildExps()
Returns a list of this relational expression's child expressions.
|
RelCollation |
getCollation()
Returns the array of
RelFieldCollations asked for by the sort
specification, from most significant to least significant. |
List<RelCollation> |
getCollationList()
Returns a description of the physical ordering (or orderings) of this
relational expression.
|
childrenAccept, deriveRowType, getInput, getInputs, getRows, replaceInputaccept, collectVariablesSet, collectVariablesUsed, computeDigest, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toStringpublic final RelCollation collation
protected final com.google.common.collect.ImmutableList<RexNode> fieldExps
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)
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 calculationpublic List<RexNode> getChildExps()
RelNodeRelNode.getInputs().
The caller should treat the list as unmodifiable; typical
implementations will return an immutable list. If there are no
child expressions, returns an empty list, not null.
getChildExps in interface RelNodegetChildExps in class AbstractRelNodeRelNode.accept(org.apache.calcite.rex.RexShuttle)public RelNode accept(RexShuttle shuttle)
RelNodeaccept in interface RelNodeaccept in class AbstractRelNodeshuttle - Shuttlepublic 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 List<RelCollation> getCollationList()
RelNodegetCollationList in interface RelNodegetCollationList in class AbstractRelNodepublic RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriterImpl.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writerCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.