kosiew commented on code in PR #17253:
URL: https://github.com/apache/datafusion/pull/17253#discussion_r2292487219
##########
datafusion-testing:
##########
Review Comment:
This should not be part of the PR
##########
datafusion/core/src/physical_planner.rs:
##########
@@ -1782,21 +1782,28 @@ pub fn create_aggregate_expr_and_maybe_filter(
physical_input_schema: &Schema,
execution_props: &ExecutionProps,
) -> Result<AggregateExprWithOptionalArgs> {
- // unpack (nested) aliased logical expressions, e.g. "sum(col) as total"
+ // Unpack (potentially nested) aliased logical expressions, e.g. "sum(col)
as total"
+ // Some functions like `count_all()` create internal aliases,
+ // Unwrap all alias layers to get to the underlying aggregate function
let (name, human_display, e) = match e {
- Expr::Alias(Alias { expr, name, .. }) => {
- (Some(name.clone()), String::default(), expr.as_ref())
+ Expr::Alias(Alias { name, .. }) => {
+ let unaliased = e.clone().unalias_nested().data;
Review Comment:
👍
--
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]