GitHub user Stibbons opened a pull request:
https://github.com/apache/spark/pull/14918
[SPARK-17360][PYSPARK] Support generator in createDataFrame
## What changes were proposed in this pull request?
Avoid useless iteration within 'data' structure when creating a data frame
from local data (so when createDataFrame uses _createFromLocal) and when 'data'
is a Python generator (instead of a 'list' or a dataframe)
- if schema is provided, only iterate once (in _createFromLocal). In this
case we skip 1 struction iteration
- if no schema is provided, we skip the useless 'map' with the 'identify'
lambda function
There are still serialization to the JVM.
## How was this patch tested?
Pyspark unit tests and standalone manual pyspark execution
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Stibbons/spark generate_in_createdf
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14918.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 #14918
----
commit 59a64707745f44465f82b326843ba115c1414d7a
Author: Gaetan Semet <[email protected]>
Date: 2016-09-01T12:27:55Z
[SPARK-17360][PYSPARK] Support generator in createDataFrame
Avoid useless iteration within 'data' structure if it is
a Python generator, instead of dict or list
(so when createDataFrame uses _createFromLocal)
- if schema is provided, only iterate once (in _createFromLocal)
In this case we skip 1 iteration
- if no schema is provided, we skip the useless 'map' with
the identify function
There are still serialization to the JVM.
Signed-off-by: Gaetan Semet <[email protected]>
----
---
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]