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

ASF GitHub Bot updated SPARK-61745:
-----------------------------------
    Labels: pull-request-available  (was: )

> Spark Connect createDataFrame fails on empty NumPy ndarray and empty PyArrow 
> Table
> ----------------------------------------------------------------------------------
>
>                 Key: SPARK-61745
>                 URL: https://issues.apache.org/jira/browse/SPARK-61745
>             Project: Spark
>          Issue Type: Bug
>          Components: Connect, PySpark
>    Affects Versions: 4.3.0
>            Reporter: Narendra Singh
>            Priority: Major
>              Labels: pull-request-available
>
> In Spark Connect, createDataFrame raises CANNOT_INFER_EMPTY_SCHEMA for an 
> empty NumPy ndarray or an empty PyArrow Table when no schema is passed. 
> Classic PySpark accepts both, because the input already carries its column 
> types.
> {code:python}
> import numpy as np
> import pyarrow as pa
> spark.createDataFrame(np.empty((0, 2))).dtypes
> spark.createDataFrame(pa.table({"a": pa.array([], pa.int64())})).dtypes
> {code}
> Classic:
> {code}
> [('_1', 'double'), ('_2', 'double')]
> [('a', 'bigint')]
> {code}
> Connect:
> {code}
> PySparkValueError: [CANNOT_INFER_EMPTY_SCHEMA] Can not infer schema from an 
> empty dataset.



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