You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Stefano Baghino (JIRA)" <ji...@apache.org> on 2016/02/17 10:28:18 UTC
[jira] [Commented] (FLINK-1159) Case style anonymous functions not
supported by Scala API
[ https://issues.apache.org/jira/browse/FLINK-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15150174#comment-15150174 ]
Stefano Baghino commented on FLINK-1159:
----------------------------------------
If that's ok with [~aljoscha] I would assign this issue to me as I've started working on a solution ([here|https://github.com/radicalbit/flink/commits/1159-implicit]) that resulted from a mailing list discussion with [~till.rohrmann] and [~StephanEwen] ([here|http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Case-style-anonymous-functions-not-supported-by-Scala-API-td10052.html]).
> 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: Aljoscha Krettek
>
> 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 Scala:
> {code}
> dataset.map{
> _ match{
> case foo:Bar => ...
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)