spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Nadeau (JIRA)" <>
Subject [jira] [Commented] (SPARK-13534) Implement Apache Arrow serializer for Spark DataFrame for use in DataFrame.toPandas
Date Wed, 12 Apr 2017 18:45:42 GMT


Jacques Nadeau commented on SPARK-13534:

Great, thanks [~holdenk]!

> Implement Apache Arrow serializer for Spark DataFrame for use in DataFrame.toPandas
> -----------------------------------------------------------------------------------
>                 Key: SPARK-13534
>                 URL:
>             Project: Spark
>          Issue Type: New Feature
>          Components: PySpark
>            Reporter: Wes McKinney
>         Attachments:
> The current code path for accessing Spark DataFrame data in Python using PySpark passes
through an inefficient serialization-deserialiation process that I've examined at a high level
here: Currently, RDD[Row] objects are being
deserialized in pure Python as a list of tuples, which are then converted to pandas.DataFrame
using its {{from_records}} alternate constructor. This also uses a large amount of memory.
> For flat (no nested types) schemas, the Apache Arrow memory layout (
can be deserialized to {{pandas.DataFrame}} objects with comparatively small overhead compared
with memcpy / system memory bandwidth -- Arrow's bitmasks must be examined, replacing the
corresponding null values with pandas's sentinel values (None or NaN as appropriate).
> I will be contributing patches to Arrow in the coming weeks for converting between Arrow
and pandas in the general case, so if Spark can send Arrow memory to PySpark, we will hopefully
be able to increase the Python data access throughput by an order of magnitude or more. I
propose to add an new serializer for Spark DataFrame and a new method that can be invoked
from PySpark to request a Arrow memory-layout byte stream, prefixed by a data header indicating
array buffer offsets and sizes.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message