HeartSaVioR commented on a change in pull request #28830: URL: https://github.com/apache/spark/pull/28830#discussion_r439903851
########## File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala ########## @@ -2548,6 +2548,21 @@ class DataFrameSuite extends QueryTest assert(df.schema === new StructType().add(StructField("d", DecimalType(38, 0)))) } } + + test("SPARK-31990: preserves the input order of colNames in dropDuplicates") { + val df = Seq((1, 2, 3, 4, 5), (1, 2, 3, 4, 5)).toDF("c", "e", "d", "a", "b") + val inputColNames = Seq("c", "b", "c", "d", "b", "c", "b") Review comment: You may want to find the case where `toSet.toSeq` produces different order than `distinct`. And then you may need to craft a streaming query doing dropDuplicate with having grouping key just you found, and run the query with Spark 2.4.x (where SPARK-31292 is not applied), and store checkpoint, and run the query with Spark 3.x (where SPARK-31292 is applied) with restoring checkpoint. There're a couple of test suites doing that - one of example is https://github.com/apache/spark/blob/8282bbf12d4e174986a649023ce3984aae7d7755/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala#L880-L952 ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org