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

SortPartition should allow chaining of KeySelectors to support different sorting orders for the fields

    XMLWordPrintableJSON

Details

    Description

      If we need to sort data in a DataSet using a KeySelector (for example to extract avro fields or when sort using field index or name is not available) we cannot have different sort orders for the fields. We can sort by a list of fields by making the keySelector return a tuple but they will all be sorted in the same order.
      To allow sort by field 1 ASC, field 2 DESC kind of semantics with KeySelectors we need to be able to chain the KeySelectors like this

      DataSet.sortPartition(field1KeySelector , Order.ASCENDING)
                      .sortPartition(field2KeySelector, Order.DESCENDING)
      

      which is currently not possible.

      Attachments

        Activity

          People

            Unassigned Unassigned
            echauchot Etienne Chauchot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: