alamb commented on code in PR #9009:
URL: https://github.com/apache/arrow-datafusion/pull/9009#discussion_r1468170121
##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -166,25 +166,67 @@ impl CommonSubexprEliminate {
window: &Window,
config: &dyn OptimizerConfig,
) -> Result<LogicalPlan> {
- let Window {
- input,
- window_expr,
- schema,
- } = window;
+ let mut window_exprs = vec![];
+ let mut arrays_per_window = vec![];
let mut expr_set = ExprSet::new();
- let input_schema = Arc::clone(input.schema());
- let arrays =
- to_arrays(window_expr, input_schema, &mut expr_set,
ExprMask::Normal)?;
+ // Get all window expressions inside the consecutive window operators.
Review Comment:
Perhaps we can add a comment here about why this is recursively looking down
into all window operations (e.g. because they all get the same input schema
and append on some window functions, but the window functions can't refer to
previous window functions).
I think perhaps you could reuse the (very nicely written) description from
this PR which explains it very well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]