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

Aljoscha Krettek resolved FLINK-1255.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 0.9
         Assignee: Aljoscha Krettek

Fixed by adding a FAQ entry explaining the situation in: 
https://github.com/apache/flink/commit/2bdfd88eb1fabd0e93bd6293213e7157ed9b1437

> Problems with generic types in Scala API
> ----------------------------------------
>
>                 Key: FLINK-1255
>                 URL: https://issues.apache.org/jira/browse/FLINK-1255
>             Project: Flink
>          Issue Type: Bug
>          Components: Scala API
>    Affects Versions: 0.7.0-incubating
>            Reporter: Sebastian Schelter
>            Assignee: Aljoscha Krettek
>             Fix For: 0.9
>
>
> the code below produces the following exception:
> {noformat}
> Error:(47, 18) could not find implicit value for evidence parameter of type 
> org.apache.flink.api.common.typeinfo.TypeInformation[K]
>     data.groupBy { extractKey }
> {noformat}
> Fixing K to Long made the code run though
> {noformat}
>   def groupCount[T, K](data: DataSet[T], extractKey: (T) => K): DataSet[(K, 
> Long)] = {
>     data.groupBy { extractKey }
>         .reduceGroup { group => countBy(extractKey, group) }
>   }
>   private[this] def countBy[T, K](extractKey: T => K,
>                                   group: Iterator[T]): (K, Long) = {
>     val key = extractKey(group.next())
>     var count = 1L
>     while (group.hasNext) {
>       group.next()
>       count += 1
>     }
>     key -> count
>   }
> {noformat}



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

Reply via email to