Skip to content

Commit

Permalink
docs(optimizer): Add example to filter pushdown on LogicalPlan::Window
Browse files Browse the repository at this point in the history
  • Loading branch information
nuno-faria committed Jan 8, 2025
1 parent 1e2bd6e commit 7465231
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datafusion/optimizer/src/push_down_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,16 @@ impl OptimizerRule for PushDownFilter {
}
})
}
// Tries to push filters based on the partition key(s) of the window function(s) used.
// Example:
// Before:
// Filter: (a > 1) and (b > 1) and (c > 1)
// Window: func() PARTITION BY [a] ...
// ---
// After:
// Filter: (b > 1) and (c > 1)
// Window: func() PARTITION BY [a] ...
// Filter: (a > 1)
LogicalPlan::Window(window) => {
// Retrieve the set of potential partition keys where we can push filters by.
// Unlike aggregations, where there is only one statement per SELECT, there can be
Expand Down

0 comments on commit 7465231

Please sign in to comment.