Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-13121

java mapWithState mishandles scala Option

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.1, 2.0.0
    • Component/s: DStreams, Java API
    • Labels:
      None

      Description

      in Spark Streaming, java mapWithState that uses Function3 has a bug in the convertion from a scala Option to a java Optional. In the conversion, the code in `StateSpec.scala`, line 222 is
      `Optional.fromNullable(v.get)`. This fails if `v`, an `Option`, is `None`, better to use `JavaUtils.optionToOptional(v)` instead.

      Workaround is to use the Function4 call to mapWithState. This call has the right conversion.

        Attachments

          Activity

            People

            • Assignee:
              gabrielenizzoli Gabriele Nizzoli
              Reporter:
              gabrielenizzoli Gabriele Nizzoli
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: