You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/10/24 09:46:30 UTC
[GitHub] aljoscha commented on a change in pull request #6784: [FLINK-7811]
Add support for Scala 2.12
aljoscha 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_r227718201
##########
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:
I don't think so, I'm changing it.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services