Class PushPredicateThroughProjectIntoWindow
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.PushPredicateThroughProjectIntoWindow
-
- All Implemented Interfaces:
Rule<FilterNode>
public class PushPredicateThroughProjectIntoWindow extends Object implements Rule<FilterNode>
This rule pushes filter predicate concerning row number symbol into WindowNode by converting it into TopNRowNumberNode. 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 (rowNumber <= 5 && a > 1) - Project (a, rowNumber) - Window (row_number() OVER (ORDER BY a)) - source (a, b)
into:- Filter (a > 1) - Project (a, rowNumber) - TopNRowNumber (maxRowCountPerPartition = 5, order by a) - source (a, b)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description PushPredicateThroughProjectIntoWindow(Metadata metadata, TypeOperators typeOperators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Result
apply(FilterNode filter, Captures captures, Rule.Context context)
Pattern<FilterNode>
getPattern()
Returns a pattern to which plan nodes this rule applies.boolean
isEnabled(Session session)
-
-
-
Constructor Detail
-
PushPredicateThroughProjectIntoWindow
public PushPredicateThroughProjectIntoWindow(Metadata metadata, TypeOperators typeOperators)
-
-
Method Detail
-
getPattern
public Pattern<FilterNode> getPattern()
Description copied from interface:Rule
Returns a pattern to which plan nodes this rule applies.- Specified by:
getPattern
in interfaceRule<FilterNode>
-
isEnabled
public boolean isEnabled(Session session)
- Specified by:
isEnabled
in interfaceRule<FilterNode>
-
apply
public Rule.Result apply(FilterNode filter, Captures captures, Rule.Context context)
- Specified by:
apply
in interfaceRule<FilterNode>
-
-