timsaucer commented on code in PR #12009:
URL: https://github.com/apache/datafusion/pull/12009#discussion_r1718228568
##########
datafusion/physical-plan/src/windows/mod.rs:
##########
@@ -112,25 +112,9 @@ pub fn create_window_expr(
))
}
WindowFunctionDefinition::AggregateUDF(fun) => {
- // Convert `Vec<PhysicalSortExpr>` into `Vec<Expr::Sort>`
- let sort_exprs = order_by
- .iter()
- .map(|PhysicalSortExpr { expr, options }| {
- let field_name = expr.to_string();
- let field_name =
field_name.split('@').next().unwrap_or(&field_name);
- Expr::Sort(SortExpr {
- expr: Box::new(col(field_name)),
- asc: !options.descending,
- nulls_first: options.nulls_first,
- })
- })
- .collect::<Vec<_>>();
-
let aggregate = AggregateExprBuilder::new(Arc::clone(fun),
args.to_vec())
.schema(Arc::new(input_schema.clone()))
.alias(name)
- .order_by(order_by.to_vec())
- .sort_exprs(sort_exprs)
Review Comment:
Thank you. I rebased on `main` and ended up getting a different error, but I
still think we need a correction. I think I'll write up a unit test as 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]