You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/04/27 18:34:00 UTC

[jira] [Closed] (CALCITE-3897) Windowed aggregate with bracket (ROWS or RANGE) without ORDER BY is invalid

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

Julian Hyde closed CALCITE-3897.
--------------------------------

> 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
>    Affects Versions: 1.22.0
>            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)