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

Hyukjin Kwon reassigned SPARK-61074:
------------------------------------

    Assignee: Hyukjin Kwon

> Write and read the collations of string fields in the metadata of the JSON of 
> a StructType, and order the keys of jsonValue, in the Python client as 
> PySpark does
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-61074
>                 URL: https://issues.apache.org/jira/browse/SPARK-61074
>             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 PySpark Connect, {{StructType.json()}} and {{jsonValue()}} write the 
> collation of a string field, also of one in an array or a map, in the 
> {{__COLLATIONS}} of the metadata of the field, as Spark does, with the type 
> of the field as "string": 
> {{{"metadata":{"__COLLATIONS":{"s":"spark.UTF8_LCASE"}},"name":"s",...,"type":"string"}}}.
>  {{StructField.fromJson}}, {{StructType.fromJson}}, and the {{fromJson}} of 
> {{ArrayType}} and {{MapType}} (with their {{fieldPath}} and 
> {{collationsMap}}) read them back. They raise {{COLLATION_INVALID_PROVIDER}} 
> for an unknown provider, and {{INVALID_JSON_DATA_TYPE_FOR_COLLATIONS}} for a 
> collation of a field that is not a string. The dicts of {{jsonValue()}} have 
> their keys in a fixed order, such as name, type, nullable and metadata for a 
> field.
> The Rust-backed Python client differs:
> * It writes the type of the field as "string collate UTF8_LCASE", without the 
> metadata.
> * {{ArrayType.fromJson}} and {{MapType.fromJson}} ignore their 
> {{collationsMap}}.
> * {{StructType.fromJson}} and {{StructField.fromJson}} raise 
> {{INVALID_DATATYPE_FORMAT}} for a field of a user-defined type.
> * {{jsonValue()}} sorts its keys.
> Write and read them 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