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 2022/12/06 03:53:19 UTC

[GitHub] [spark] amaliujia commented on a diff in pull request #38917: [SPARK-41391][SQL] The output column name of `groupBy.agg(count_distinct)` is incorrect

amaliujia commented on code in PR #38917:
URL: https://github.com/apache/spark/pull/38917#discussion_r1040422665


##########
sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala:
##########
@@ -1134,6 +1134,11 @@ class DataFrameSuite extends QueryTest
     checkAnswer(approxSummaryDF, approxSummaryResult)
   }
 
+  test("SPARK-41391: Correct the output column name of groupBy.agg(count_distinct)") {
+    val df = person.groupBy("id").agg(count_distinct(col("name")))
+    assert(df.columns === Array("id", "count(DISTINCT name)"))

Review Comment:
   nit: does it make sense to compare with columns from the SQL example?



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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