From 97386b3debd5f352b61dfed194ab9495fecbe834 Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Thu, 22 Jan 2015 00:08:06 -0800 Subject: [PATCH] address comment --- core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala b/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala index 98412f1faa9ea..6f5d3dda377de 100644 --- a/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala +++ b/core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala @@ -383,6 +383,7 @@ private[spark] object PythonRDD extends Logging { dataOut.write(bytes) } } + def writeS(str: String) { if (str == null) { dataOut.writeInt(SpecialLengths.NULL) @@ -390,6 +391,7 @@ private[spark] object PythonRDD extends Logging { writeUTF(str, dataOut) } } + if (iter.hasNext) { val first = iter.next() val newIter = Seq(first).iterator ++ iter