Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-1159

Case style anonymous functions not supported by Scala API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • API / Scala
    • None

    Description

      In Scala it is very common to define anonymous functions of the following form

      {
      case foo: Bar => foobar(foo)
      case _ => throw new RuntimeException()
      }
      

      These case style anonymous functions are not supported yet by the Scala API. Thus, one has to write redundant code to name the function parameter.

      What works is the following pattern, but it is not intuitive for someone coming from Scala:

      dataset.map{
        _ match{
          case foo:Bar => ...
        }
      }
      

      Attachments

        Activity

          People

            stefanobaghino Stefano Baghino
            trohrmann Till Rohrmann
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: