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 |
---|---|
PCollection<BeamRecord> |
buildBeamPipeline(PCollectionTuple inputPCollections,
BeamSqlEnv sqlEnv)
A
BeamRelNode is a recursive structure, the
BeamQueryPlanner visits it with a DFS(Depth-First-Search)
algorithm. |
Sort |
copy(RelTraitSet traitSet,
RelNode newInput,
RelCollation newCollation,
RexNode offset,
RexNode fetch) |
public BeamSortRel(RelOptCluster cluster, RelTraitSet traits, RelNode child, RelCollation collation, RexNode offset, RexNode fetch)
public PCollection<BeamRecord> buildBeamPipeline(PCollectionTuple inputPCollections, BeamSqlEnv sqlEnv) throws java.lang.Exception
BeamRelNode
BeamRelNode
is a recursive structure, the
BeamQueryPlanner
visits it with a DFS(Depth-First-Search)
algorithm.buildBeamPipeline
in interface BeamRelNode
java.lang.Exception
public Sort copy(RelTraitSet traitSet, RelNode newInput, RelCollation newCollation, RexNode offset, RexNode fetch)