Github user Stibbons commented on a diff in the pull request:
https://github.com/apache/spark/pull/14918#discussion_r77174813
--- Diff: python/pyspark/sql/session.py ---
@@ -373,16 +375,16 @@ def _createFromRDD(self, rdd, schema, samplingRatio):
rdd = rdd.map(schema.toInternal)
return rdd, schema
- def _createFromLocal(self, data, schema):
+ def _createFromLocal(self, prepareFunc, data, schema):
"""
Create an RDD for DataFrame from a list or pandas.DataFrame,
returns
the RDD and schema.
"""
- # make sure data could consumed multiple times
- if not isinstance(data, list):
- data = list(data)
if schema is None or isinstance(schema, (list, tuple)):
+ # make sure data could consumed multiple times
+ if not isinstance(data, list):
--- End diff --
here we can convert to list because there will be several iterations on the
data
---
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]