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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to