cloud-fan commented on a change in pull request #24482: [SPARK-27581][SQL] DataFrame countDistinct("*") shouldn't fail with AnalysisException URL: https://github.com/apache/spark/pull/24482#discussion_r279228389
########## File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ########## @@ -358,9 +358,10 @@ object functions { * @since 1.3.0 */ @scala.annotation.varargs - def countDistinct(expr: Column, exprs: Column*): Column = { - withAggregateFunction(Count.apply((expr +: exprs).map(_.expr)), isDistinct = true) - } + def countDistinct(expr: Column, exprs: Column*): Column = + // For usage like countDistinct("*"), we should let analyzer expand star and Review comment: how do we handle it in `count`? ---------------------------------------------------------------- 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