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

Julian Hyde commented on CALCITE-3897:
--------------------------------------

Many thanks for your research, [~amaliujia]. It is good to know that we are on 
solid ground. I wasn't sure until you checked.

> Windowed aggregate with bracket (ROWS or RANGE) without ORDER BY is invalid
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-3897
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3897
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Rui Wang
>            Priority: Major
>
> I believe that windowed aggregate with bracket (ROWS or RANGE) without ORDER 
> BY is invalid. If so, we should throw.
> [~danny0405] 
> [reports|https://github.com/apache/calcite/pull/1896#discussion_r403420946] 
> that the syntax is invalid on MSSQL 2017.
> Someone should check the SQL standard. If it is invalid in the SQL standard 
> (but only if) the validator should give an error.
> I am a little ambivalent. A missing {{ORDER BY}} is basically sorting by zero 
> columns, an of course it's not deterministic, but even with {{ORDER BY}}, the 
> ordering may not be deterministic (e.g. apply {{ORDER BY deptno}} to the 
> {{Emp}} table). So we should go with the SQL standard.



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

Reply via email to