Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/554#discussion_r12010283
--- Diff: core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala
---
@@ -301,15 +301,23 @@ private[spark] object PythonRDD {
throw new SparkException("Unexpected Tuple2 element type " +
pair._1.getClass)
}
case other =>
- throw new SparkException("Unexpected element type " +
first.getClass)
+ if (other == null) {
+ logDebug("Encountered NULL element from iterator. We skip
writing NULL to stream.")
+ } else {
+ throw new SparkException("Unexpected element type " +
first.getClass)
+ }
}
}
}
def writeUTF(str: String, dataOut: DataOutputStream) {
- val bytes = str.getBytes(UTF8)
- dataOut.writeInt(bytes.length)
- dataOut.write(bytes)
+ if (str == null) {
+ logDebug("Encountered NULL string. We skip writing NULL to stream.")
+ } else {
+ val bytes = str.getBytes(UTF8)
--- End diff --
the indent is off here (2-space indent)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---