You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Etienne Chauchot (Jira)" <ji...@apache.org> on 2020/04/16 08:39:00 UTC

[jira] [Comment Edited] (FLINK-17074) Deprecate DataStream.keyBy() that use tuple/expression keys

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

Etienne Chauchot edited comment on FLINK-17074 at 4/16/20, 8:38 AM:
--------------------------------------------------------------------

[~aljoscha], I'm taking this ticket as my first Flink ticket. I have one question though: you were talking about Datastream.keyBy() only, but should the deprecation in favor or KeySelector be extended to all key uses (Dataset.groupby, Dataset.distinct, Dataset.partition*, ...)


was (Author: echauchot):
[~aljoscha], I'm taking this ticket as my first Flink ticket. I have one question though: you were talking about Datastream.keyBy() only, but should the deprecation in favor or KeySelector be extended to all key uses (Dataset.groupby, Dataset.distinct, Dataset.*partition*, ...)

> Deprecate DataStream.keyBy() that use tuple/expression keys
> -----------------------------------------------------------
>
>                 Key: FLINK-17074
>                 URL: https://issues.apache.org/jira/browse/FLINK-17074
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / DataStream
>            Reporter: Aljoscha Krettek
>            Priority: Major
>              Labels: starter
>             Fix For: 1.11.0
>
>
> Currently you can either specify a {{KeySelector}}, tuple positions, and expression keys? I think {{KeySelectors}} are strictly superior and with lambdas (or function references) quite easy to use.  Tuple/expression keys use reflection underneath to do the field accesses, so performance is strictly worse. Also, when using a {{KeySelector}} you will have a meaningful key type {{KEY}} in your operations while for tuple/expression keys the key type is simply {{Tuple}}.
> Tuple/expression keys were introduced before Java got support for lambdas in Java 8 and before we added the Table API. Nowadays, using a lambda is little more typing than using an expression key but is (possibly) faster and more type safe. The Table API should be used for these more expression-based/relational use cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)