public class BeamSortRel extends org.apache.calcite.rel.core.Sort implements BeamRelNode
BeamRelNode to replace a Sort node.
Since Beam does not fully supported global sort we are using Top to implement the
Sort algebra. The following types of ORDER BY are supported:
select * from t order by id desc limit 10;
select * from t order by id desc limit 10 offset 5;
but Order BY without a limit is NOT supported:
select * from t order by id desc
Top, the result of a `ORDER BY LIMIT` must fit into the
memory of a single machine.
| Constructor and Description |
|---|
BeamSortRel(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) |
| Modifier and Type | Method and Description |
|---|---|
PTransform<PCollectionList<Row>,PCollection<Row>> |
buildPTransform() |
org.apache.calcite.rel.core.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) |
int |
getCount() |
boolean |
isLimitOnly() |
accept, computeSelfCost, copy, copy, explainTerms, getChildExps, getCollation, getCollationListchildrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInputaccept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, sole, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPCollectionInputs, getPipelineOptions, isBoundedaccept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInputpublic BeamSortRel(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)
public boolean isLimitOnly()
public int getCount()
public PTransform<PCollectionList<Row>,PCollection<Row>> buildPTransform()
buildPTransform in interface BeamRelNodepublic org.apache.calcite.rel.core.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)
copy in class org.apache.calcite.rel.core.Sort