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

Sean Hsuan-Yi Chu commented on DRILL-3597:
------------------------------------------

This is an important bug. But we probably can not fix in 1.2 since

1. Fortunately, it would fail (with less informative message though) if users 
say that. It would not go into execution phase, so we do not need to worry 
about the possibility of wrong result.

2. It is in Parser. We have to fix in Calcite's core. Filed a jira here:
https://issues.apache.org/jira/browse/CALCITE-883



> Disable RESPECT NULLS, IGNORE NULLS option for LEAD, LAG window functions
> -------------------------------------------------------------------------
>
>                 Key: DRILL-3597
>                 URL: https://issues.apache.org/jira/browse/DRILL-3597
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Relational Operators
>    Affects Versions: 1.2.0
>            Reporter: Khurram Faraaz
>            Assignee: Sean Hsuan-Yi Chu
>             Fix For: 1.3.0
>
>
> The SQL standard defines a RESPECT NULLS or IGNORE NULLS option for lead, 
> lag, first_value, and last_value window functions. We need to (disable it) 
> and report a meaningful message to user if either of these two options is 
> used in a query, with any of those functions.
> Currently we throw parse errors when these options are used in query.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select lead(c1,2) respect nulls over w from 
> union_01 window w as (partition by c3 order by c1);
> Error: PARSE ERROR: Encountered "nulls" at line 1, column 27.
> Was expecting one of:
>     "FROM" ...
>     "," ...
>    
> [Error Id: 73d09692-6374-41a2-bce0-db73d2828f1f on centos-04.qa.lab:31010] 
> (state=,code=0)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select lead(c1,2) ignore nulls over w from 
> union_01 window w as (partition by c3 order by c1);
> Error: PARSE ERROR: Encountered "nulls" at line 1, column 26.
> Was expecting one of:
>     "FROM" ...
>     "," ...
>     
> [Error Id: a7bd21b3-b46c-417d-a9d9-aa6d0378b0fc on centos-04.qa.lab:31010] 
> (state=,code=0)
> {code}



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

Reply via email to