uros-db commented on PR #47525:
URL: https://github.com/apache/spark/pull/47525#issuecomment-2259656739

   I think @nikolamand-db will have to do that because it's his PR, I don't 
have access to edit PR description
   
   
   ```
   ### What changes were proposed in this pull request?
   Fix `RewriteDistinctAggregates` rule to deal properly with aggregation on 
DISTINCT literals.
   
   
   ### Why are the changes needed?
   Aggregation with DISTINCT literal gives wrong results. For example:
   `select count(distinct 1) from t` returns 1, while the correct result should 
be 0.
   For reference:
   `select count(1) from t` returns 0, which is the correct and expected result.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, this fixes a critical bug in Spark.
   
   
   ### How was this patch tested?
   New e2e SQL tests for aggregates with DISTINCT literals.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.
   
   ```
   


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to