[
https://issues.apache.org/jira/browse/SPARK-47365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825769#comment-17825769
]
Ian Cook commented on SPARK-47365:
----------------------------------
It looks like all the pieces required to enable this already exist:
[https://github.com/apache/spark/blob/efc1aedce6d767b40862a8bbade3e250fe7b5637/python/pyspark/sql/pandas/conversion.py#L128-L133]
I'll open a PR to take a stab at this.
> Add toArrow() DataFrame method
> ------------------------------
>
> Key: SPARK-47365
> URL: https://issues.apache.org/jira/browse/SPARK-47365
> Project: Spark
> Issue Type: Improvement
> Components: Input/Output, PySpark
> Affects Versions: 3.5.1
> Reporter: Ian Cook
> Priority: Major
>
> Over in the Apache Arrow community, we hear from a lot of users who want to
> return the contents of a PySpark DataFrame as a [PyArrow
> Table|https://arrow.apache.org/docs/python/generated/pyarrow.Table.html].
> Currently the only way to do this is:
> *PySpark DataFrame* --> *pandas DataFrame* --> *PyArrow Table*
> This adds significant overhead compared to going direct from PySpark
> DataFrame to PyArrow Table. Since [PySpark already goes through PyArrow to
> convert to
> pandas|https://spark.apache.org/docs/latest/api/python/user_guide/sql/arrow_pandas.html],
> would it be possible to publicly expose a *toArrow()* method of the Spark
> DataFrame class?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]