[
https://issues.apache.org/jira/browse/FLINK-35037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17835139#comment-17835139
]
yisha zhou commented on FLINK-35037:
------------------------------------
Hi [~libenchao] , could you please assign this task to me? I've already
prepared a PR.
> Optimize uniqueKeys and upsertKeys inference of windows with ROW_NUMBER
> -----------------------------------------------------------------------
>
> Key: FLINK-35037
> URL: https://issues.apache.org/jira/browse/FLINK-35037
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Affects Versions: 1.20.0
> Reporter: yisha zhou
> Priority: Major
>
> 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:
> {code:java}
> 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 {code}
> (class, rn) is a valid upsert/unique keys candidate.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)