GitHub user jhu-chang opened a pull request:
https://github.com/apache/spark/pull/8881
[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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jhu-chang/spark Fix_Transform
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/8881.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #8881
----
commit bd77f3cd5a2fac5d66dd4d89b0db176345cad9e3
Author: Jacker Hu <[email protected]>
Date: 2015-09-23T07:02:09Z
Fix SPARK-10772: using Option in TransformedDStream instead of Some
----
---
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]