Victoria Markman created DRILL-3396:
---------------------------------------

             Summary: 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
            Reporter: Victoria Markman


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)

Reply via email to