Josh Rosen created SPARK-10544:
----------------------------------
Summary: Serialization of Python namedtuples in functions /
closures is broken
Key: SPARK-10544
URL: https://issues.apache.org/jira/browse/SPARK-10544
Project: Spark
Issue Type: Bug
Components: PySpark
Affects Versions: 1.5.0
Reporter: Josh Rosen
Priority: Blocker
Fix For: 1.5.1
The following example works on Spark 1.4.1 but not in 1.5:
{code}
from collections import namedtuple
Person = namedtuple("Person", "id firstName lastName")
rdd = sc.parallelize([1]).map(lambda x: Person(1, "Jon", "Doe"))
rdd.count()
{code}
In 1.5, this gives an "AttributeError: 'builtin_function_or_method' object has
no attribute '__code__'" error.
It looks like PySpark has unit tests for serializing individual namedtuples
with cloudpickle.dumps and for serializing RDDs of namedtuples, but I don't
think that we have any tests for namedtuples in closures.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]