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 2020/04/29 03:21:24 UTC

[GitHub] [spark] maropu commented on a change in pull request #28351: [SPARK-31500][SQL] collect_set() of BinaryType returns duplicate elements

maropu commented on a change in pull request #28351:
URL: https://github.com/apache/spark/pull/28351#discussion_r417045797



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala
##########
@@ -528,6 +536,17 @@ class DataFrameAggregateSuite extends QueryTest
       df.select(collect_set($"a"), sort_array(collect_set($"b"))),
       Seq(Row(Seq(1, 2, 3), Seq(Row(2, 2), Row(4, 1))))
     )
+
+    val a = "aa".getBytes
+    val b = "bb".getBytes
+    val c = "cc".getBytes
+    val d = "dd".getBytes
+    val df1 = Seq((a, b), (a, b), (c, d))
+      .toDF("x", "y")
+      .select(struct($"x", $"y").as("a"))
+    val ret = df1.select(collect_set($"a")).collect()
+      .map(r => r.getAs[mutable.WrappedArray[_]](0)).head
+    assert(ret.length == 2)

Review comment:
       Could you move the new tests into a new test unit like `test("SPARK-31500: collect_set() of BinaryType returns duplicate elements") { ..}`?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org