You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/06/15 11:15:31 UTC

[GitHub] [spark] tanelk commented on a change in pull request #32904: [SPARK-33122][FOLLOW-UP][SQL] Distinct aggs are not duplicate sensitive

tanelk commented on a change in pull request #32904:
URL: https://github.com/apache/spark/pull/32904#discussion_r651689815



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RemoveRedundantAggregates.scala
##########
@@ -67,4 +67,8 @@ object RemoveRedundantAggregates extends Rule[LogicalPlan] with AliasHelper {
 
     upperHasNoDuplicateSensitiveAgg && upperRefsOnlyDeterministicNonAgg
   }
+
+  private def isDuplicateSensitive(ae: AggregateExpression): Boolean = {
+    !ae.isDistinct && !EliminateDistinct.isDuplicateAgnostic(ae.aggregateFunction)

Review comment:
       `EliminateDistinct.isDuplicateAgnostic` looks at `AggregateFunction`,  `isDistinct` is a property of a `AggregateExpression`.
   




-- 
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:
users@infra.apache.org



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