[ 
https://issues.apache.org/jira/browse/SPARK-61165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon resolved SPARK-61165.
----------------------------------
    Resolution: Fixed

Issue resolved by pull request 354
[https://github.com/apache/spark-connect-rust/pull/354]

> Keep the metadata of a StructField as its own dict, so that edits of it show 
> in the field and its struct, in the Python client as PySpark does
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-61165
>                 URL: https://issues.apache.org/jira/browse/SPARK-61165
>             Project: Spark
>          Issue Type: Bug
>          Components: Connect
>    Affects Versions: connect-rust-4.3.0
>            Reporter: Hyukjin Kwon
>            Assignee: Hyukjin Kwon
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: connect-rust-4.3.0
>
>
> In-place edits of a StructField's metadata are silently lost in the Python 
> client: `f.metadata["comment"] = "x"` changes a temporary dict, so 
> `f.metadata` is `{}` again, and the edit is not in `f.jsonValue()`, the 
> struct holding the field, or the schema of a DataFrame created with it. 
> PySpark's StructField keeps its metadata dict, so the edit persists.
> Repro: `f = StructField("a", IntegerType()); f.metadata["comment"] = "x"; 
> f.metadata` gives `{}` in the client and `{'comment': 'x'}` in PySpark 4.3.0.
> The fix keeps the dict in the field and reads the metadata from it when the 
> field is converted to a Rust type.



--
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