[ https://issues.apache.org/jira/browse/FLINK-31960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927618#comment-17927618 ]
yisha zhou commented on FLINK-31960: ------------------------------------ [~jark] hi Jark, I encountered the same issue. However my frame is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW which is the default frame when there isn't frame declared. And then I refer to SQL standard 2003 (Calcite 1.29 referred to it) in which Chapter 6.10 Rule 6a said '{_}If <rank function type> or ROW_NUMBER is specified, then t{_}_he window framing of WDX shall not be present._' How do you recommend to understand this rule? Is 'RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW' a window framing that cannot be used with RANK, LEAD and so on? > 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 > Affects Versions: 1.17.0 > 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)