Repository: spark Updated Branches: refs/heads/master be5dd881f -> d0df2ca40
[SPARK-13121][STREAMING] java mapWithState mishandles scala Option Already merged into 1.6 branch, this PR is to commit to master the same change Author: Gabriele Nizzoli <[email protected]> Closes #11028 from gabrielenizzoli/patch-1. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d0df2ca4 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d0df2ca4 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d0df2ca4 Branch: refs/heads/master Commit: d0df2ca40953ba581dce199798a168af01283cdc Parents: be5dd88 Author: Gabriele Nizzoli <[email protected]> Authored: Tue Feb 2 13:20:01 2016 -0800 Committer: Shixiong Zhu <[email protected]> Committed: Tue Feb 2 13:20:01 2016 -0800 ---------------------------------------------------------------------- .../src/main/scala/org/apache/spark/streaming/StateSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/d0df2ca4/streaming/src/main/scala/org/apache/spark/streaming/StateSpec.scala ---------------------------------------------------------------------- diff --git a/streaming/src/main/scala/org/apache/spark/streaming/StateSpec.scala b/streaming/src/main/scala/org/apache/spark/streaming/StateSpec.scala index 66f646d..e6724fe 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/StateSpec.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/StateSpec.scala @@ -221,7 +221,7 @@ object StateSpec { mappingFunction: JFunction3[KeyType, Optional[ValueType], State[StateType], MappedType]): StateSpec[KeyType, ValueType, StateType, MappedType] = { val wrappedFunc = (k: KeyType, v: Option[ValueType], s: State[StateType]) => { - mappingFunction.call(k, Optional.ofNullable(v.get), s) + mappingFunction.call(k, JavaUtils.optionToOptional(v), s) } StateSpec.function(wrappedFunc) } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
