flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-1159) Case style anonymous functions not supported by Scala API
Date Wed, 24 Feb 2016 16:02:18 GMT

    [ https://issues.apache.org/jira/browse/FLINK-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15163236#comment-15163236

ASF GitHub Bot commented on FLINK-1159:

Github user tillrohrmann commented on the pull request:

    How do you want to do the implicit conversion if you return a `DataSet[T]`. If it makes
the code more readable, then I think it's a good idea :-)
    We should have a test, which makes sure that the implicit conversion works when you import
the corresponding package. That should be enough.
    I think we could add the documentation to the streaming guide. We could add a new page
with the methods and link it from the scala tab of [DataStream Transformations](https://ci.apache.org/projects/flink/flink-docs-master/apis/streaming/index.html#datastream-transformations)
in the streaming guide.

> Case style anonymous functions not supported by Scala API
> ---------------------------------------------------------
>                 Key: FLINK-1159
>                 URL: https://issues.apache.org/jira/browse/FLINK-1159
>             Project: Flink
>          Issue Type: Bug
>          Components: Scala API
>            Reporter: Till Rohrmann
>            Assignee: Stefano Baghino
> In Scala it is very common to define anonymous functions of the following form
> {code}
> {
> case foo: Bar => foobar(foo)
> case _ => throw new RuntimeException()
> }
> {code}
> 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
> {code}
> dataset.map{
>   _ match{
>     case foo:Bar => ...
>   }
> }
> {code}

This message was sent by Atlassian JIRA

View raw message