beliefer commented on a change in pull request #27058: [SPARK-30395][SQL] When one or more DISTINCT aggregate expressions operate on the same field, the DISTINCT aggregate expression allows the use of the FILTER clause URL: https://github.com/apache/spark/pull/27058#discussion_r364538991
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregates.scala ########## @@ -317,7 +363,74 @@ object RewriteDistinctAggregates extends Rule[LogicalPlan] { } Aggregate(groupByAttrs, patchedAggExpressions, firstAggregate) } else { Review comment: I will add check like` } else if (distinctAggGroups.size == 1) {` But I have checked whether the aggregation has a filter in the following places https://github.com/apache/spark/blob/a4fd143fa92cb569764b669e5c53f6dfd1f1ae6a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDistinctAggregates.scala#L367 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org