amanomer 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_r362714875
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
 ##########
 @@ -207,6 +207,29 @@ trait CheckAnalysis extends PredicateHelper {
                 s"of type ${condition.dataType.catalogString} is not a 
boolean.")
 
           case Aggregate(groupingExprs, aggregateExprs, child) =>
+            val aggExpressions = aggregateExprs.flatMap { e =>
+              e.collect {
+                case ae: AggregateExpression => ae
+              }
+            }
+            val aggWithDistinctAndFilters = aggExpressions.filter(e => 
e.isDistinct)
 
 Review comment:
   Why is this `aggWithDistinctAndFilters` since this is only checking for 
distinct?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to