-
- Downloads
[SPARK-10772] [STREAMING] [SCALA] NullPointerException when transform function...
[SPARK-10772] [STREAMING] [SCALA] NullPointerException when transform function in DStream returns NULL Currently, the ```TransformedDStream``` will using ```Some(transformFunc(parentRDDs, validTime))``` as compute return value, when the ```transformFunc``` somehow returns null as return value, the followed operator will have NullPointerExeception. This fix uses the ```Option()``` instead of ```Some()``` to deal with the possible null value. When ```transformFunc``` returns ```null```, the option will transform null to ```None```, the downstream can handle ```None``` correctly. NOTE (2015-09-25): The latest fix will check the return value of transform function, if it is ```NULL```, a spark exception will be thrown out Author: Jacker Hu <gt.hu.chang@gmail.com> Author: jhu-chang <gt.hu.chang@gmail.com> Closes #8881 from jhu-chang/Fix_Transform.
Showing
- streaming/src/main/scala/org/apache/spark/streaming/dstream/TransformedDStream.scala 10 additions, 2 deletions...g/apache/spark/streaming/dstream/TransformedDStream.scala
- streaming/src/test/scala/org/apache/spark/streaming/BasicOperationsSuite.scala 13 additions, 0 deletions...ala/org/apache/spark/streaming/BasicOperationsSuite.scala
Please register or sign in to comment