GitHub user davies opened a pull request:
https://github.com/apache/spark/pull/11664
[SPARK-XX] [SQL] fast serialization for collecting DataFrame/Dataset
## What changes were proposed in this pull request?
When we call DataFrame/Dataset.collect(), Java serializer (or Kryo
Serializer) will be used to serialize the UnsafeRows in executor, then
deserialize them into UnsafeRows in driver. Java serializer (and Kyro
serializer) are slow on millions rows, because they try to find out the same
rows, but usually there is no same rows.
This PR will serialize the UnsafeRows as fixed size byte array, then Java
serializer (or Kyro serializer) serialize the bytes very fast (there are fewer
blocks and byte array are not compared by content).
Test this with
```
sqlContext.range(5 << 20).collect()
```
After this PR, the collect() finished in 2 seconds (instead of 12 seconds
before this PR). (this requires #11659)
## How was this patch tested?
Existing unit tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/davies/spark serialize_row
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11664.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11664
----
commit ac1a40b3f04fd934ed2c4e82f7c62c28c4059e35
Author: Davies Liu <[email protected]>
Date: 2016-03-11T23:18:20Z
fast serialization for collecting DataFrame/Dataset
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]