Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-17074

Deprecate DataStream.keyBy() that use tuple/expression keys

    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              echauchot Etienne Chauchot
              aljoscha Aljoscha Krettek
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: