Khurram Faraaz created DRILL-3597:
-------------------------------------

             Summary: 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: Chris Westin


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