[ 
https://issues.apache.org/jira/browse/CALCITE-5863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17781755#comment-17781755
 ] 

LakeShen commented on CALCITE-5863:
-----------------------------------

Thanks the PR,[~itiels] ,fixed via 
[919f50d|https://github.com/apache/calcite/commit/919f50d2132e06e069453179fd01fffa0c87008b]

Thanks *[mihaibudiu|https://github.com/mihaibudiu] ,* 
{*}[JiajunBernoulli|https://github.com/JiajunBernoulli] 
,{*}{*}[LakeShen|https://github.com/LakeShen]{*}  for ** reivewing.{*}{*}

> Calcite rejects valid query with multiple ORDER BY columns and constant RANGE 
> bounds in window functions
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5863
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5863
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.34.0
>            Reporter: Itiel Sadeh
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.36.0
>
>
> Usually, it is not valid to specify multiple ORDER BY columns with RANGE 
> bounds in window functions:
> {code:java}
> SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN 3 preceding and 4 following) 
> from t;{code}
> However, it is valid if both bounds are "constant" bound (CURRENT ROW, 
> UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING), i.e:
> {code:java}
> SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN UNBOUNDED PRECEDING and 
> CURRENT ROW) from t;{code}
> (tested on PostgreSQL and SQL Server)
> Calcite will incorrectly reject it. 



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

Reply via email to