[
https://issues.apache.org/jira/browse/SPARK-61138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hyukjin Kwon updated SPARK-61138:
---------------------------------
Description:
PySpark's VariantVal.__str__ is its JSON (VariantUtils.to_json, as toJson),
while its __repr__ is "VariantVal(value, metadata)". The client's VariantVal
has no __str__, so str(v) is its repr of bytes.
Also, PySpark's createDataFrame raises PySparkValueError "Rows cannot be of
type VariantVal" for rows that are VariantVals, such as
createDataFrame([VariantVal.parseJson("2")], "v variant"), also without a
schema or of the schema "variant". A VariantVal of PySpark has a __dict__, so
it is taken as a row (to_row of LocalDataToArrowConversion). The client's
VariantVal has none, so the client took it as a value: a DataFrame of one row.
Apache Spark's test_variant_type fails on this client. The client's str of a
VariantVal should be its JSON, and its createDataFrame should reject the rows
that are VariantVals, as PySpark's does.
was:
PySpark's VariantVal.__str__ is its JSON (VariantUtils.to_json, as toJson),
while its __repr__ is "VariantVal(value, metadata)". The client's VariantVal
has no __str__, so str(v) is its repr of bytes.
Apache Spark's test_variant_type fails on this client. The client's str of a
VariantVal should be its JSON, as PySpark's is.
Summary: Make str of a VariantVal its JSON, and createDataFrame reject
rows that are VariantVals, in the Python client as PySpark does (was: Make str
of a VariantVal its JSON in the Python client as PySpark does)
> Make str of a VariantVal its JSON, and createDataFrame reject rows that are
> VariantVals, in the Python client as PySpark does
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: SPARK-61138
> URL: https://issues.apache.org/jira/browse/SPARK-61138
> Project: Spark
> Issue Type: Bug
> Components: Connect
> Affects Versions: connect-rust-4.3.0
> Reporter: Hyukjin Kwon
> Priority: Major
> Fix For: connect-rust-4.3.0
>
>
> PySpark's VariantVal.__str__ is its JSON (VariantUtils.to_json, as toJson),
> while its __repr__ is "VariantVal(value, metadata)". The client's VariantVal
> has no __str__, so str(v) is its repr of bytes.
> Also, PySpark's createDataFrame raises PySparkValueError "Rows cannot be of
> type VariantVal" for rows that are VariantVals, such as
> createDataFrame([VariantVal.parseJson("2")], "v variant"), also without a
> schema or of the schema "variant". A VariantVal of PySpark has a __dict__, so
> it is taken as a row (to_row of LocalDataToArrowConversion). The client's
> VariantVal has none, so the client took it as a value: a DataFrame of one row.
> Apache Spark's test_variant_type fails on this client. The client's str of a
> VariantVal should be its JSON, and its createDataFrame should reject the rows
> that are VariantVals, as PySpark's 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]