You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Josh Rosen (JIRA)" <ji...@apache.org> on 2015/09/10 21:02:45 UTC
[jira] [Created] (SPARK-10544) Serialization of Python namedtuples
in functions / closures is broken
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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org