zhengruifeng commented on code in PR #44177: URL: https://github.com/apache/spark/pull/44177#discussion_r1414903099
########## 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: hmm, to avoid such incompatibility issues, I think I need to use `ListMap` instead -- 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