public class BeamSortRel extends 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(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
RelCollation collation,
RexNode offset,
RexNode fetch) |
Modifier and Type | Method and Description |
---|---|
Sort |
copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
PTransform<PCollectionTuple,PCollection<Row>> |
toPTransform()
A
BeamRelNode is a recursive structure, the BeamQueryPlanner visits it with a
DFS(Depth-First-Search) algorithm. |
public BeamSortRel(RelOptCluster cluster, RelTraitSet traits, RelNode child, RelCollation collation, RexNode offset, RexNode fetch)
public PTransform<PCollectionTuple,PCollection<Row>> toPTransform()
BeamRelNode
BeamRelNode
is a recursive structure, the BeamQueryPlanner
visits it with a
DFS(Depth-First-Search) algorithm.toPTransform
in interface BeamRelNode
public Sort copy(RelTraitSet traitSet, RelNode newInput, RelCollation newCollation, RexNode offset, RexNode fetch)