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