Class PushPredicateThroughProjectIntoRowNumber

java.lang.Object
io.trino.sql.planner.iterative.rule.PushPredicateThroughProjectIntoRowNumber
All Implemented Interfaces:
Rule<FilterNode>

public class PushPredicateThroughProjectIntoRowNumber extends Object implements Rule<FilterNode>
This rule pushes filter predicate concerning row number symbol into RowNumberNode by modifying maxRowCountPerPartition. It skips an identity projection separating FilterNode from RowNumberNode in the plan tree. TODO This rule should be removed as soon as RowNumberNode becomes capable of absorbing pruning projections (i.e. capable of pruning outputs).

Transforms:


 - Filter (rowNumber <= 5 && a > 1)
     - Project (a, rowNumber)
         - RowNumber (maxRowCountPerPartition = 10)
             - source (a, b)
 
into:

 - Filter (a > 1)
     - Project (a, rowNumber)
         - RowNumber (maxRowCountPerPartition = 5)
             - source (a, b)