wudidapaopao commented on code in PR #25849:
URL: https://github.com/apache/datafusion/pull/25849#discussion_r4135066649
##########
datafusion/core/tests/sql/unparser.rs:
##########
@@ -567,9 +567,8 @@ async fn
optimized_duckdb_unparse_preserves_nested_aggregate_scope() -> Result<(
assert!(
sql.contains(concat!(
- r#"FROM (SELECT sum("total_revenue") AS "alias2", "#,
- r#"date_part('year', "signup_date") AS "group_alias_0", "#,
- r#""customer_id" AS "alias1" "#
+ r#"FROM (SELECT date_part('year', "signup_date") AS
"group_alias_0", "#,
Review Comment:
`SingleDistinctToGroupBy` first rewrites `COUNT(DISTINCT customer_id)` into
an inner `GROUP BY customer_id` and an outer `COUNT(alias1)`. Since
`customer_id` is non-nullable, this PR simplifies the outer `COUNT(alias1)` to
`COUNT()`, allowing `OptimizeProjections` to remove `alias1` from the inner
output.
--
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]