Hyukjin Kwon created SPARK-61140:
------------------------------------

             Summary: Send the renames of DataFrame.withColumnsRenamed in their 
order, in the Rust core and the Python client, as PySpark does
                 Key: SPARK-61140
                 URL: https://issues.apache.org/jira/browse/SPARK-61140
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: Hyukjin Kwon


PySpark's DataFrame.withColumnsRenamed sends its renames in the order of their 
dict (the repeated renames of WithColumnsRenamed), and the server applies them 
in that order. So df.withColumnsRenamed({"id": "a", "a": "b"}) has the columns 
["b"], and df.withColumnsRenamed({"a": "b", "id": "a"}) has ["a"].

The Rust core of spark-connect-rust keeps the renames of a WithColumnsRenamed 
plan in a HashMap. So it sends them in the order of their hashes, not in the 
order given, and the columns of such renames depend on that order. Apache 
Spark's test_ordering_of_with_columns_renamed fails on the client: ['a'] != 
['b'].

The core should keep the renames in their order, and send them in it, as 
PySpark does.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to