You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Victoria Markman (JIRA)" <ji...@apache.org> on 2015/06/26 19:12:04 UTC

[jira] [Updated] (DRILL-3396) Add other function names to the error message disallowing frame definition

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

Victoria Markman updated DRILL-3396:
------------------------------------
    Component/s: Query Planning & Optimization

> Add other function names to the error message disallowing frame definition
> --------------------------------------------------------------------------
>
>                 Key: DRILL-3396
>                 URL: https://issues.apache.org/jira/browse/DRILL-3396
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.1.0
>            Reporter: Victoria Markman
>              Labels: window_function
>
> According to SQL Standard ( ISO/IEC 9075-2:2011(E) 6.10 <window function>) window frame definition is not allowed.
> page 220
> 7) If <ntile function>, <lead or lag function>, <rank function type> or ROW_NUMBER is specified, then:
> a) If <ntile function>, <lead or lag function>, RANK or DENSE_RANK is specified, then the window ordering clause WOC of WDX shall be present.
> {color:red}b) The window framing clause of WDX shall not be present.{color}
> Calcite already throws an error, however it only mentions RANK and DENSE_RANK functions even if your query does not contain them.
> It is confusing and we should fix that for row_number and other functions as well. 
> {code}
> 0: jdbc:drill:schema=dfs> select row_number() over(partition by b1 order by c1 RANGE UNBOUNDED PRECEDING) from t1;
> Error: PARSE ERROR: From line 1, column 54 to line 1, column 58: ROW/RANGE not allowed with RANK or DENSE_RANK functions
> [Error Id: 20924dea-8b2e-43e1-8f88-87675016e905 on atsqa4-133.qa.lab:31010] (state=,code=0))
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)