You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2018/02/10 09:48:00 UTC

[jira] [Assigned] (SPARK-23380) Make toPandas fall back to Arrow optimization disabled when schema is not supported in the Arrow optimization

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

Apache Spark reassigned SPARK-23380:
------------------------------------

    Assignee: Apache Spark

> Make toPandas fall back to Arrow optimization disabled when schema is not supported in the Arrow optimization 
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-23380
>                 URL: https://issues.apache.org/jira/browse/SPARK-23380
>             Project: Spark
>          Issue Type: Sub-task
>          Components: PySpark
>    Affects Versions: 2.3.0
>            Reporter: Hyukjin Kwon
>            Assignee: Apache Spark
>            Priority: Major
>
> Seems we can check the schema ahead and fall back in toPandas.
> Please see this case below:
> {code}
> df = spark.createDataFrame([[{'a': 1}]])
> spark.conf.set("spark.sql.execution.arrow.enabled", "false")
> df.toPandas()
> spark.conf.set("spark.sql.execution.arrow.enabled", "true")
> df.toPandas()
> {code}
> {code}
> ...
> py4j.protocol.Py4JJavaError: An error occurred while calling o42.collectAsArrowToPython.
> ...
> java.lang.UnsupportedOperationException: Unsupported data type: map<string,bigint>
> {code}
> In case of {{createDataFrame}}, we fall back to make this at least working even though the optimisation is disabled.
> {code}
> df = spark.createDataFrame([[{'a': 1}]])
> spark.conf.set("spark.sql.execution.arrow.enabled", "false")
> pdf = df.toPandas()
> spark.createDataFrame(pdf).show()
> spark.conf.set("spark.sql.execution.arrow.enabled", "true")
> spark.createDataFrame(pdf).show()
> {code}
> {code}
> ...
> ... UserWarning: Arrow will not be used in createDataFrame: Error inferring Arrow type ...
> +--------+
> |      _1|
> +--------+
> |[a -> 1]|
> +--------+
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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