cloud-fan commented on code in PR #37825:
URL: https://github.com/apache/spark/pull/37825#discussion_r980860055
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregates.scala:
##########
@@ -402,7 +405,28 @@ object RewriteDistinctAggregates extends Rule[LogicalPlan]
{
}
Aggregate(groupByAttrs, patchedAggExpressions, firstAggregate)
} else {
- a
+ // We may have one distinct group only because we grouped using
ExpressionSet.
+ // To prevent SparkStrategies from complaining during sanity check, we
need to check whether
+ // the original list of aggregate expressions had multiple distinct
groups and, if so,
+ // patch that list so we have only one distinct group.
Review Comment:
I don't quite understand this. Shall we use `ExpressionSet` to fix issues in
`SparkStrategies` 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]