Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/9070#discussion_r41731988
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/dstream/TransformedDStream.scala
---
@@ -39,7 +39,10 @@ class TransformedDStream[U: ClassTag] (
override def slideDuration: Duration = parents.head.slideDuration
override def compute(validTime: Time): Option[RDD[U]] = {
- val parentRDDs = parents.map(_.getOrCompute(validTime).orNull).toSeq
+ val parentRDDs = parents.map { parent =>
parent.getOrCompute(validTime).getOrElse(
--- End diff --
If "can't be computed now" and returns None, here `orNull` should not be
used, it will get null and pass by user, which will lead to NPE. For example:
```
inputStream.transform(_.union(rdd))
```
If inputStream returns `None` as what you mean by "can't be computed now",
this clause will throw NPE, so we should guard out this situation.
---
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]