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 2019/04/29 02:53:19 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #24482:
[SPARK-27581][SQL] DataFrame countDistinct("*") shouldn't fail with
AnalysisException
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org