[ 
https://issues.apache.org/jira/browse/FLINK-7811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aljoscha Krettek closed FLINK-7811.
-----------------------------------
      Resolution: Fixed
    Release Note: 
When using Scala 2.12 you might have to add explicit type annotations in places 
where they were not required when using Scala 2.11. This is an excerpt from the 
TransitiveClosureNaive.scala example in the Flink code base that shows the 
changes that could be required.

Previous code:
{code}
val terminate = prevPaths
 .coGroup(nextPaths)
 .where(0).equalTo(0) {
   (prev, next, out: Collector[(Long, Long)]) => {
     val prevPaths = prev.toSet
     for (n <- next)
       if (!prevPaths.contains(n)) out.collect(n)
   }
}
{code}

With Scala 2.12 you have to change it to:
{code}
val terminate = prevPaths
 .coGroup(nextPaths)
 .where(0).equalTo(0) {
   (prev: Iterator[(Long, Long)], next: Iterator[(Long, Long)], out: 
Collector[(Long, Long)]) => {
       val prevPaths = prev.toSet
       for (n <- next)
         if (!prevPaths.contains(n)) out.collect(n)
     }
}
{code}

The reason for this is that Scala 2.12 changes how lambdas are implemented. 
They now use the lambda support using SAM interfaces introduced in Java 8. This 
makes some method calls ambiguous because now both Scala-style lambdas and SAMs 
are candidates for methods were it was previously clear which method would be 
invoked.

Implemented on master in f8cbbb505c4ddb4955050689310447e2991a0484 and previous 
commits.

> Add support for Scala 2.12
> --------------------------
>
>                 Key: FLINK-7811
>                 URL: https://issues.apache.org/jira/browse/FLINK-7811
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Scala API
>            Reporter: Aljoscha Krettek
>            Assignee: Aljoscha Krettek
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to