Skip to content
Snippets Groups Projects
Commit d0df2ca4 authored by Gabriele Nizzoli's avatar Gabriele Nizzoli Committed by Shixiong Zhu
Browse files

[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 <mail@nizzoli.net>

Closes #11028 from gabrielenizzoli/patch-1.
parent be5dd881
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment