[
https://issues.apache.org/jira/browse/SPARK-55294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109356#comment-18109356
]
Zahed M commented on SPARK-55294:
---------------------------------
I have opened a PR to add support for PyArrow-backed dtypes ({{{}ArrowDtype{}}}
and PyArrow-backed {{{}StringDtype{}}}) in PySpark's pandas API:
[https://github.com/apache/spark/pull/58405]
*Summary of approach:*
* Integrated {{ArrowDtype}} in {{typehints.py}} by delegating directly to
PySpark's existing {{from_arrow_type()}} and {{to_arrow_type()}} conversion
helpers.
* Added {{is_pyarrow_backed_dtype()}} and extended
{{{}InternalField.from_struct_field(){}}}, {{{}column_op(){}}},
{{{}combine_frames(){}}}, and indexing operators to preserve PyArrow-backed
return dtypes (e.g. {{{}bool[pyarrow]{}}}) during operations.
* Added unit and integration test coverage in {{test_typedef.py}} and
{{{}test_string_ops.py{}}}.
> Support pyarrow based data types
> --------------------------------
>
> Key: SPARK-55294
> URL: https://issues.apache.org/jira/browse/SPARK-55294
> Project: Spark
> Issue Type: Sub-task
> Components: PySpark
> Affects Versions: 4.2.0
> Reporter: Tian Gao
> Priority: Major
> Labels: pull-request-available
>
> Pandas 3 supports pyarrow based data types like `bool[pyarrow]`. We have no
> code to work with it. The problem is if `pyarrow` is installed, `string` type
> will automatically use pyarrow backend, which means the operations between
> `string` types will result in pyarrow dtypes. e.g. if we compare two string
> series, the result would be a `bool[pyarrow]` series.
> We need some extra work to make this happen. We probable need to add more
> arguments to `InternalField.from_struct_field` so pyspark knows if it should
> convert the data back to a pyarrow based format.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]