Class PushPredicateThroughProjectIntoWindow
java.lang.Object
io.trino.sql.planner.iterative.rule.PushPredicateThroughProjectIntoWindow
- All Implemented Interfaces:
Rule<FilterNode>
This rule pushes filter predicate concerning a ranking symbol into WindowNode
by converting it into TopNRankingNode. It skips an identity projection
separating FilterNode from WindowNode in the plan tree.
TODO This rule should be removed as soon as WindowNode becomes capable of absorbing pruning projections (i.e. capable of pruning outputs).
Transforms:
- Filter (ranking <= 5 && a > 1)
- Project (a, ranking)
- Window ([row_number()|rank()] OVER (ORDER BY a))
- source (a, b)
into:
- Filter (a > 1)
- Project (a, ranking)
- TopNRanking (type = [ROW_NUMBER|RANK], maxRankingPerPartition = 5, order by a)
- source (a, b)
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(FilterNode filter, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.boolean
-
Constructor Details
-
PushPredicateThroughProjectIntoWindow
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<FilterNode>
-
isEnabled
- Specified by:
isEnabledin interfaceRule<FilterNode>
-
apply
- Specified by:
applyin interfaceRule<FilterNode>
-