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:57:54 UTC

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

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


##########
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:
   nice, will update



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