dongjoon-hyun commented on code in PR #44177: URL: https://github.com/apache/spark/pull/44177#discussion_r1414901137
########## sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala: ########## @@ -987,6 +987,12 @@ class DataFrameSuite extends QueryTest parameters = Map("columnName" -> "`age`")) } + test("SPARK-46260: withColumnsRenamed should respect the Map ordering") { + val df = spark.range(10).toDF() + assert(df.withColumnsRenamed(Map("id" -> "a", "a" -> "b")).columns === Array("b")) + assert(df.withColumnsRenamed(Map("a" -> "b", "id" -> "a")).columns === Array("a")) + } Review Comment: Thank you for this addition. Actually, `Map` has many incompatibility issues across multiple Scala versions. For example, Scala 2.11/2.12/2.13. For now, since we have only Scala 2.13, I guess the behavior was consistent on master branch. And, this PR will help it more. Also, cc @LuciferYang , too. -- 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-unsubscr...@spark.apache.org 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