cloud-fan commented on code in PR #42531:
URL: https://github.com/apache/spark/pull/42531#discussion_r1302472237
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAggregates.scala:
##########
@@ -42,11 +42,12 @@ object RemoveRedundantAggregates extends Rule[LogicalPlan]
with AliasHelper {
)
// We might have introduces non-deterministic grouping expression
Review Comment:
I have a different idea. I think it's risky to put the new grouping
expressions back to the `Aggregate`, as the grouping expression contains things
in the SELECT list. This is a long-standing issue and I feel it's better to
just create a `Project` below the `Aggregate` to calculate grouping
expressions, and other optimizer rules can merge/eliminate this extra `Project`
if it only contains `Attributes`.
--
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]