You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2021/08/06 03:54:00 UTC

[jira] [Updated] (FLINK-23643) Support RANK() function for TopN

     [ https://issues.apache.org/jira/browse/FLINK-23643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu updated FLINK-23643:
----------------------------
    Summary: Support RANK() function for TopN  (was: I repeated the same problem: ROW/RANGE not allowed with RANK, DENSE_RANK or ROW_NUMBER functions)

> Support RANK() function for TopN
> --------------------------------
>
>                 Key: FLINK-23643
>                 URL: https://issues.apache.org/jira/browse/FLINK-23643
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table SQL / Planner
>    Affects Versions: 1.12.0
>            Reporter: YUJIANBO
>            Priority: Major
>
> I found a problem that was fixed in 1.12.0 and FLINK-18440, but I repeated the same problem:
> ROW/RANGE not allowed with RANK, DENSE_RANK or ROW_NUMBER functions.
> this is my sql:
> ```
> create temporary view tmp as 
> select 
>    area_zip,
>    store_id,
>    product_id,
>    batch_id,
>    RANK() over (PARTITION BY area_zip,store_id,product_id ORDER BY ts DESC RANGE BETWEEN INTERVAL '5' MINUTE preceding AND CURRENT ROW) AS num_rank 
> from pricechangelogs;
> insert into print_table 
> select * from tmp where num_rank = 1;
> ```



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