diff options
author | Prashant Sharma <prashant.s@imaginea.com> | 2013-12-11 10:21:53 +0530 |
---|---|---|
committer | Prashant Sharma <prashant.s@imaginea.com> | 2013-12-11 10:21:53 +0530 |
commit | 603af51bb5257744ce0db28e7f10db6a2ba899ec (patch) | |
tree | 31ad611d8d56147ec90108d2b3a92d38eae4d150 /python/pyspark/rdd.py | |
parent | 17db6a9041d5e83d7b6fe47f9c36758d0613fcd6 (diff) | |
parent | d2efe13574090e93c600adeacc7f6356bc196e6c (diff) | |
download | spark-603af51bb5257744ce0db28e7f10db6a2ba899ec.tar.gz spark-603af51bb5257744ce0db28e7f10db6a2ba899ec.tar.bz2 spark-603af51bb5257744ce0db28e7f10db6a2ba899ec.zip |
Merge branch 'master' into akka-bug-fix
Conflicts:
core/pom.xml
core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
pom.xml
project/SparkBuild.scala
streaming/pom.xml
yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocationHandler.scala
Diffstat (limited to 'python/pyspark/rdd.py')
-rw-r--r-- | python/pyspark/rdd.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/pyspark/rdd.py b/python/pyspark/rdd.py index d2cb5f191a..61720dcf1a 100644 --- a/python/pyspark/rdd.py +++ b/python/pyspark/rdd.py @@ -605,7 +605,10 @@ class RDD(object): '0\\n1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n' """ def func(split, iterator): - return (str(x).encode("utf-8") for x in iterator) + for x in iterator: + if not isinstance(x, basestring): + x = unicode(x) + yield x.encode("utf-8") keyed = PipelinedRDD(self, func) keyed._bypass_serializer = True keyed._jrdd.map(self.ctx._jvm.BytesToString()).saveAsTextFile(path) |