public abstract class Sort
extends org.apache.calcite.rel.SingleRel
implements org.apache.calcite.rel.hint.Hintable
Temporarily copy from calcite to cherry-pick [CALCITE-5107] and will be removed when upgrade the latest calcite.
Modifier and Type | Field and Description |
---|---|
org.apache.calcite.rel.RelCollation |
collation |
org.apache.calcite.rex.RexNode |
fetch |
protected com.google.common.collect.ImmutableList<org.apache.calcite.rel.hint.RelHint> |
hints |
org.apache.calcite.rex.RexNode |
offset |
Constructor and Description |
---|
Sort(org.apache.calcite.rel.RelInput input)
Creates a Sort by parsing serialized output.
|
Sort(org.apache.calcite.plan.RelOptCluster cluster,
org.apache.calcite.plan.RelTraitSet traits,
List<org.apache.calcite.rel.hint.RelHint> hints,
org.apache.calcite.rel.RelNode child,
org.apache.calcite.rel.RelCollation collation,
org.apache.calcite.rex.RexNode offset,
org.apache.calcite.rex.RexNode fetch)
Creates a Sort.
|
Sort(org.apache.calcite.plan.RelOptCluster cluster,
org.apache.calcite.plan.RelTraitSet traits,
org.apache.calcite.rel.RelNode child,
org.apache.calcite.rel.RelCollation collation)
Creates a Sort.
|
Sort(org.apache.calcite.plan.RelOptCluster cluster,
org.apache.calcite.plan.RelTraitSet traits,
org.apache.calcite.rel.RelNode child,
org.apache.calcite.rel.RelCollation collation,
org.apache.calcite.rex.RexNode offset,
org.apache.calcite.rex.RexNode fetch)
Creates a Sort.
|
Modifier and Type | Method and Description |
---|---|
org.apache.calcite.rel.RelNode |
accept(org.apache.calcite.rex.RexShuttle shuttle) |
org.apache.calcite.plan.RelOptCost |
computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner,
org.apache.calcite.rel.metadata.RelMetadataQuery mq) |
Sort |
copy(org.apache.calcite.plan.RelTraitSet traitSet,
List<org.apache.calcite.rel.RelNode> inputs) |
Sort |
copy(org.apache.calcite.plan.RelTraitSet traitSet,
org.apache.calcite.rel.RelNode newInput,
org.apache.calcite.rel.RelCollation newCollation) |
abstract Sort |
copy(org.apache.calcite.plan.RelTraitSet traitSet,
org.apache.calcite.rel.RelNode newInput,
org.apache.calcite.rel.RelCollation newCollation,
org.apache.calcite.rex.RexNode offset,
org.apache.calcite.rex.RexNode fetch) |
org.apache.calcite.rel.RelWriter |
explainTerms(org.apache.calcite.rel.RelWriter pw) |
org.apache.calcite.rel.RelCollation |
getCollation()
Returns the array of
RelFieldCollation s asked for by the sort specification, from
most significant to least significant. |
com.google.common.collect.ImmutableList<org.apache.calcite.rel.hint.RelHint> |
getHints() |
List<org.apache.calcite.rex.RexNode> |
getSortExps()
Returns the sort expressions.
|
boolean |
isEnforcer() |
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInput
accept, 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, toString
public final org.apache.calcite.rel.RelCollation collation
public final org.apache.calcite.rex.RexNode offset
public final org.apache.calcite.rex.RexNode fetch
protected final com.google.common.collect.ImmutableList<org.apache.calcite.rel.hint.RelHint> hints
public Sort(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, org.apache.calcite.rel.RelNode child, org.apache.calcite.rel.RelCollation collation)
cluster
- Cluster this relational expression belongs totraits
- Traitschild
- input relational expressioncollation
- array of sort specificationspublic Sort(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, org.apache.calcite.rel.RelNode child, org.apache.calcite.rel.RelCollation collation, org.apache.calcite.rex.RexNode offset, org.apache.calcite.rex.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(org.apache.calcite.plan.RelOptCluster cluster, org.apache.calcite.plan.RelTraitSet traits, List<org.apache.calcite.rel.hint.RelHint> hints, org.apache.calcite.rel.RelNode child, org.apache.calcite.rel.RelCollation collation, org.apache.calcite.rex.RexNode offset, org.apache.calcite.rex.RexNode fetch)
cluster
- Cluster this relational expression belongs totraits
- Traitshints
- Hints for this nodechild
- 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(org.apache.calcite.rel.RelInput input)
public final Sort copy(org.apache.calcite.plan.RelTraitSet traitSet, List<org.apache.calcite.rel.RelNode> inputs)
copy
in interface org.apache.calcite.rel.RelNode
copy
in class org.apache.calcite.rel.AbstractRelNode
public final Sort copy(org.apache.calcite.plan.RelTraitSet traitSet, org.apache.calcite.rel.RelNode newInput, org.apache.calcite.rel.RelCollation newCollation)
public abstract Sort copy(org.apache.calcite.plan.RelTraitSet traitSet, org.apache.calcite.rel.RelNode newInput, org.apache.calcite.rel.RelCollation newCollation, org.apache.calcite.rex.RexNode offset, org.apache.calcite.rex.RexNode fetch)
public org.apache.calcite.plan.RelOptCost computeSelfCost(org.apache.calcite.plan.RelOptPlanner planner, org.apache.calcite.rel.metadata.RelMetadataQuery mq)
computeSelfCost
in interface org.apache.calcite.rel.RelNode
computeSelfCost
in class org.apache.calcite.rel.AbstractRelNode
public org.apache.calcite.rel.RelNode accept(org.apache.calcite.rex.RexShuttle shuttle)
accept
in interface org.apache.calcite.rel.RelNode
accept
in class org.apache.calcite.rel.AbstractRelNode
public boolean isEnforcer()
isEnforcer
in interface org.apache.calcite.rel.RelNode
isEnforcer
in class org.apache.calcite.rel.AbstractRelNode
public org.apache.calcite.rel.RelCollation getCollation()
RelFieldCollation
s 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<org.apache.calcite.rex.RexNode> getSortExps()
public org.apache.calcite.rel.RelWriter explainTerms(org.apache.calcite.rel.RelWriter pw)
explainTerms
in class org.apache.calcite.rel.SingleRel
public com.google.common.collect.ImmutableList<org.apache.calcite.rel.hint.RelHint> getHints()
getHints
in interface org.apache.calcite.rel.hint.Hintable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.