Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/8881#discussion_r41481438
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/dstream/TransformedDStream.scala
---
@@ -38,6 +39,11 @@ class TransformedDStream[U: ClassTag] (
override def compute(validTime: Time): Option[RDD[U]] = {
val parentRDDs = parents.map(_.getOrCompute(validTime).orNull).toSeq
- Some(transformFunc(parentRDDs, validTime))
+ val transformedRDD = transformFunc(parentRDDs, validTime)
+ if (transformedRDD == null) {
+ throw new SparkException("Transform function must not return null. "
+
+ "Return RDD.empty to return no elements as the result of the
transformation.")
--- End diff --
"Return RDD.empty instead to represent no element as the result of
transformation" ?
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]