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

Hyukjin Kwon reassigned SPARK-60946:
------------------------------------

    Assignee: Hyukjin Kwon

> Send user-defined, VARIANT, GEOMETRY and GEOGRAPHY values in createDataFrame, 
> and collect spatial values, in the Python client as PySpark does
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-60946
>                 URL: https://issues.apache.org/jira/browse/SPARK-60946
>             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
>
>
> PySpark Connect's {{createDataFrame}} converts these values of local rows to 
> Arrow ({{LocalDataToArrowConversion}}). The Rust-backed Python client raises 
> {{TypeError: unsupported value type for createDataFrame}} for each of them, 
> so these PySpark 4.3.0 results differ:
> * A value of a user-defined type is sent as the serialized value of its SQL 
> type: with {{ExamplePoint}} of {{pyspark.testing.objects}}, 
> {{createDataFrame([(ExamplePoint(1.0, 2.0),)])}} gives {{struct<_1:udt>}} and 
> the row {{Row(_1=ExamplePoint(1.0,2.0))}}.
> * A {{VariantVal}} is sent as a VARIANT: 
> {{createDataFrame([(spark.sql("SELECT parse_json('{\"a\": 
> 1}')").first()[0],)])}} gives {{struct<_1:variant>}}, whose value's 
> {{toJson()}} is {{'{"a":1}'}}.
> * A {{Geometry}} or a {{Geography}} is sent as a value of its type: 
> {{createDataFrame([(Geometry.fromWKB(wkb, 4326),)])}} gives 
> {{struct<_1:geometry(4326)>}}, and a {{Geography}} 
> {{struct<_1:geography(4326)>}}.
> Their types are inferred as in PySpark with SPARK-60908. Send the values as 
> PySpark does, in the Rust core and in the Python client, for inferred and 
> explicit schemas.
> As PySpark's {{ArrowTableToRowsConversion}}, a collected GEOMETRY or 
> GEOGRAPHY is the {{Geometry}} or {{Geography}} of its WKB and srid, which 
> have the {{srid}} and {{wkb}} attributes: the client collects {{Row(srid=..., 
> wkb=...)}}, and its {{Geometry}} and {{Geography}} have no such attributes.



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