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

ASF GitHub Bot commented on FLINK-1159:
---------------------------------------

Github user tillrohrmann commented on the pull request:

    https://github.com/apache/flink/pull/1704#issuecomment-196314763
  
    @stefanobaghino, really good work :-) I think we're close to get this 
merged. I had some minor comments.
    
    Concerning the testing, I agree with @StephanEwen that it's not really 
necessary to execute a complete program for each new extension method. Instead, 
I think it is sufficient to check that the right operator/stream transformation 
has been instantiated. The operators and stream transformations should be 
already well tested. For the `DataSet` methods you could do something like
    
    ```
    val identityMapDs = ds.mapWith(identity)
    assertTrue(identityMapDs.javaSet.isInstanceOf[MapOperator[String, String]])
    ```
    
    And for the `DataStream` methods
    
    ```
    val identity = stream.mapWith{case x => x}
    
assertTrue(identity.javaStream.getTransformation.asInstanceOf[OneInputTransformation[Int,
 Int]]
          .getOperator.isInstanceOf[StreamMap[Int, Int]])
    ```


> 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 Scala:
> {code}
> dataset.map{
>   _ match{
>     case foo:Bar => ...
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to