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

Optimize uniqueKeys and upsertKeys inference of windows with ROW_NUMBER

    XMLWordPrintableJSON

Details

    Description

      In current Implementation, relNodes with Window type will only deliver upsert/unique keys of their inputs.

      However windows with ROW_NUMBER can also produce upsert/unique keys.

      For example:

      select id, name, score, age, class,
          row_number() over(partition by class order by name) as rn,
          rank() over (partition by class order by score) as rk,
          dense_rank() over (partition by class order by score) as drk,
          avg(score) over (partition by class order by score) as avg_score,
          max(score) over (partition by age) as max_score,
          count(id) over (partition by age) as cnt
      from student 

      (class, rn) is a valid upsert/unique keys candidate. 

      Attachments

        Issue Links

          Activity

            People

              nilerzhou yisha zhou
              nilerzhou yisha zhou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: