static class ProjectToWindowRule.WindowedAggRelSplitter extends CalcRelSplitter
RexOver) and ordinary expressions.CalcRelSplitter.RelType| Modifier and Type | Field and Description |
|---|---|
private static CalcRelSplitter.RelType[] |
REL_TYPES |
program, relBuilder| Constructor and Description |
|---|
WindowedAggRelSplitter(Calc calc,
RelBuilder relBuilder) |
| Modifier and Type | Method and Description |
|---|---|
private DirectedGraph<Integer,DefaultEdge> |
createGraphFromExpression(List<RexNode> exprs) |
protected List<Set<Integer>> |
getCohorts()
Returns a list of sets of expressions that should be on the same level.
|
private List<Integer> |
getRank(DirectedGraph<Integer,DefaultEdge> graph) |
private boolean |
isDependent(DirectedGraph<Integer,DefaultEdge> graph,
List<Integer> rank,
int ordinal1,
int ordinal2) |
canImplement, execute, handleprivate static final CalcRelSplitter.RelType[] REL_TYPES
WindowedAggRelSplitter(Calc calc, RelBuilder relBuilder)
protected List<Set<Integer>> getCohorts()
CalcRelSplitterFor example, if this method returns { {3, 5}, {4, 7} }, it means that expressions 3 and 5, should be on the same level, and expressions 4 and 7 should be on the same level. The two cohorts do not need to be on the same level.
The list is best effort. If it is not possible to arrange that the
expressions in a cohort are on the same level, the CalcRelSplitter.execute()
method will still succeed.
The default implementation of this method returns the empty list; expressions will be put on the most suitable level. This is generally the lowest possible level, except for literals, which are placed at the level where they are used.
getCohorts in class CalcRelSplitterprivate boolean isDependent(DirectedGraph<Integer,DefaultEdge> graph, List<Integer> rank, int ordinal1, int ordinal2)
private List<Integer> getRank(DirectedGraph<Integer,DefaultEdge> graph)
private DirectedGraph<Integer,DefaultEdge> createGraphFromExpression(List<RexNode> exprs)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.