public abstract class SortExchange extends Exchange
Exchange and Sort
simultaneously.
Whereas a Sort produces output with a particular
RelCollation and an Exchange produces output
with a particular RelDistribution, the output
of a SortExchange has both the required collation and distribution.
Several implementations of SortExchange are possible; the purpose of this base class allows rules to be written that apply to all of those implementations.
| Modifier and Type | Field and Description |
|---|---|
protected RelCollation |
collation |
distributiondigest, id, rowType, traitSet| Modifier | Constructor and Description |
|---|---|
|
SortExchange(RelInput input)
Creates a SortExchange by parsing serialized output.
|
protected |
SortExchange(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RelDistribution distribution,
RelCollation collation)
Creates a SortExchange.
|
| Modifier and Type | Method and Description |
|---|---|
SortExchange |
copy(RelTraitSet traitSet,
RelNode newInput,
RelDistribution newDistribution) |
abstract SortExchange |
copy(RelTraitSet traitSet,
RelNode newInput,
RelDistribution newDistribution,
RelCollation newCollation) |
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. |
computeSelfCost, copy, getDistributionchildrenAccept, deriveRowType, getInput, getInputs, getRows, replaceInputaccept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toStringprotected final RelCollation collation
protected SortExchange(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RelDistribution distribution, RelCollation collation)
cluster - Cluster this relational expression belongs totraitSet - Trait setinput - Input relational expressiondistribution - Distribution specificationpublic SortExchange(RelInput input)
public final SortExchange copy(RelTraitSet traitSet, RelNode newInput, RelDistribution newDistribution)
public abstract SortExchange copy(RelTraitSet traitSet, RelNode newInput, RelDistribution newDistribution, RelCollation newCollation)
public 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
RelWriterImpl.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class Exchangepw - Plan writerCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.