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_r366151574
########## File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala ########## @@ -192,8 +192,10 @@ class AnalysisErrorSuite extends AnalysisTest { errorTest( "DISTINCT and FILTER cannot be used in aggregate functions at the same time", - CatalystSqlParser.parsePlan("SELECT count(DISTINCT a) FILTER (WHERE c > 1) FROM TaBlE2"), - "DISTINCT and FILTER cannot be used in aggregate functions at the same time" :: Nil) + CatalystSqlParser.parsePlan("SELECT sum(DISTINCT b), " + + "count(DISTINCT a) FILTER (WHERE c > 1) FROM TaBlE2"), + "When there are multiple DISTINCT aggregate expressions acting on different " + + "fields, any DISTINCT aggregate expression not allow use FILTER clause." :: Nil) Review comment: At https://github.com/apache/spark/blob/45d69714a7a1bb6dc8a05a11a2b885174f5d3fca/sql/core/src/test/resources/sql-tests/inputs/group-by-filter.sql#L67 ---------------------------------------------------------------- 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