You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "padavan (Jira)" <ji...@apache.org> on 2023/04/27 16:37:00 UTC

[jira] [Updated] (FLINK-31960) SQL OverBy. Error on a code that does not exist

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

padavan updated FLINK-31960:
----------------------------
    Description: 
Hello. I use latest Flink. And want make query with LEAD, LAG function , but i got error 

 
{noformat}
SQL validation failed. From line 1, column 138 to line 1, column 142: ROW/RANGE not allowed with RANK, DENSE_RANK or ROW_NUMBER functions{noformat}
But i dont use RANK, DENSE_RANK or ROW_NUMBER functions in my code
{code:java}
        Table win = te.sqlQuery(
                "SELECT userId, " +
                "lead(`count`, 1) over w as ld, " +
                "lag(`count`, 1) over w as lg " +
                "FROM users " +
                "WINDOW w AS (" +
                "PARTITION BY userId " +
                "ORDER BY proctime " +
                "RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING AND CURRENT ROW)"
        );{code}
 

I found what this problem is fix in 2020 but not...

[https://github.com/apache/flink/pull/12868]

  was:
Hello. I use latest Flink. And want make query with LEAD, LAG function , but i got error 

 
{noformat}
SQL validation failed. From line 1, column 138 to line 1, column 142: ROW/RANGE not allowed with RANK, DENSE_RANK or ROW_NUMBER functions{noformat}
But i dont use RANK, DENSE_RANK or ROW_NUMBER functions in my code
{code:java}
        Table win = te.sqlQuery(
                "SELECT userId, " +
                "lead(`count`, 1) over w as ld, " +
                "lag(`count`, 1) over w as lg " +
                "FROM users " +
                "WINDOW w AS (" +
                "PARTITION BY userId " +
                "ORDER BY proctime " +
                "RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING AND CURRENT ROW)"
        );{code}
 

I find what is problem fix in 2020 but not...

https://github.com/apache/flink/pull/12868


> SQL OverBy. Error on a code that does not exist 
> ------------------------------------------------
>
>                 Key: FLINK-31960
>                 URL: https://issues.apache.org/jira/browse/FLINK-31960
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>            Reporter: padavan
>            Priority: Major
>
> Hello. I use latest Flink. And want make query with LEAD, LAG function , but i got error 
>  
> {noformat}
> SQL validation failed. From line 1, column 138 to line 1, column 142: ROW/RANGE not allowed with RANK, DENSE_RANK or ROW_NUMBER functions{noformat}
> But i dont use RANK, DENSE_RANK or ROW_NUMBER functions in my code
> {code:java}
>         Table win = te.sqlQuery(
>                 "SELECT userId, " +
>                 "lead(`count`, 1) over w as ld, " +
>                 "lag(`count`, 1) over w as lg " +
>                 "FROM users " +
>                 "WINDOW w AS (" +
>                 "PARTITION BY userId " +
>                 "ORDER BY proctime " +
>                 "RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING AND CURRENT ROW)"
>         );{code}
>  
> I found what this problem is fix in 2020 but not...
> [https://github.com/apache/flink/pull/12868]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)