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

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

StephanEwen commented on a change in pull request #6784: [FLINK-7811] Add 
support for Scala 2.12
URL: https://github.com/apache/flink/pull/6784#discussion_r226954765
 
 

 ##########
 File path: 
flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/DataStream.scala
 ##########
 @@ -414,6 +414,22 @@ class DataStream[T](stream: JavaStream[T]) {
     asScalaStream(new JavaKeyedStream(stream, keyExtractor, keyType))
   }
 
+  /**
+   * Groups the elements of a DataStream by the given K key to
+   * be used with grouped operators like grouped reduce or grouped 
aggregations.
+   */
+  def keyBy[K: TypeInformation](fun: KeySelector[T, K]): KeyedStream[T, K] = {
+
+    val cleanFun = clean(fun)
+    val keyType: TypeInformation[K] = implicitly[TypeInformation[K]]
+
+    val keyExtractor = new KeySelector[T, K] with ResultTypeQueryable[K] {
 
 Review comment:
   Do we need to wrap this in a `ResultTypeQueryable` if we explicitly pass the 
key type info below?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> 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