[ 
https://issues.apache.org/jira/browse/SPARK-42020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699825#comment-17699825
 ] 

Apache Spark commented on SPARK-42020:
--------------------------------------

User 'ueshin' has created a pull request for this issue:
https://github.com/apache/spark/pull/40402

> createDataFrame with UDT
> ------------------------
>
>                 Key: SPARK-42020
>                 URL: https://issues.apache.org/jira/browse/SPARK-42020
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Connect
>    Affects Versions: 3.4.0
>            Reporter: Hyukjin Kwon
>            Priority: Major
>
> {code}
> pyspark/sql/tests/test_types.py:596 
> (TypesParityTests.test_apply_schema_with_udt)
> self = <pyspark.sql.tests.connect.test_parity_types.TypesParityTests 
> testMethod=test_apply_schema_with_udt>
>     def test_apply_schema_with_udt(self):
>         row = (1.0, ExamplePoint(1.0, 2.0))
>         schema = StructType(
>             [
>                 StructField("label", DoubleType(), False),
>                 StructField("point", ExamplePointUDT(), False),
>             ]
>         )
> >       df = self.spark.createDataFrame([row], schema)
> ../test_types.py:605: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> ../../connect/session.py:282: in createDataFrame
>     _table = pa.Table.from_pylist([dict(zip(_cols, list(item))) for item in 
> _data])
> pyarrow/table.pxi:3700: in pyarrow.lib.Table.from_pylist
>     ???
> pyarrow/table.pxi:5221: in pyarrow.lib._from_pylist
>     ???
> pyarrow/table.pxi:3575: in pyarrow.lib.Table.from_arrays
>     ???
> pyarrow/table.pxi:1383: in pyarrow.lib._sanitize_arrays
>     ???
> pyarrow/table.pxi:1364: in pyarrow.lib._schema_from_arrays
>     ???
> pyarrow/array.pxi:320: in pyarrow.lib.array
>     ???
> pyarrow/array.pxi:39: in pyarrow.lib._sequence_to_array
>     ???
> pyarrow/error.pxi:144: in pyarrow.lib.pyarrow_internal_check_status
>     ???
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> >   ???
> E   pyarrow.lib.ArrowInvalid: Could not convert ExamplePoint(1.0,2.0) with 
> type ExamplePoint: did not recognize Python value type when inferring an 
> Arrow data type
> pyarrow/error.pxi:100: ArrowInvalid
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to