Class FilterWindowTransposeRule

All Implemented Interfaces:
TransformationRule

@Enclosing public class FilterWindowTransposeRule extends RelRule<FilterWindowTransposeRule.Config> implements TransformationRule
Planner rule that pushes a Filter past a Window.

If Filter condition used columns belongs Window partition keys, then we could push the condition past the Window.

For example:


    LogicalProject(NAME=[$0], DEPTNO=[$1], EXPR$2=[$2])
     LogicalFilter(condition=[>($1, 0)])
       LogicalProject(NAME=[$1], DEPTNO=[$0], EXPR$2=[$2])
         LogicalWindow(window#0=[window(partition {0} aggs [COUNT()])])
           LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
  

will convert to:


    LogicalProject(NAME=[$1], DEPTNO=[$0], EXPR$2=[$2])
      LogicalWindow(window#0=[window(partition {0} aggs [COUNT()])])
        LogicalFilter(condition=[>($0, 0)])
          LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
 
See Also: