[
https://issues.apache.org/jira/browse/DRILL-3647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700364#comment-14700364
]
Deneche A. Hakim commented on DRILL-3647:
-----------------------------------------
Calcite doesn't seem to allow passing NULL to NTILE.
[~jni] can you take a look at this and let us know if this is expected or if
this should be fixed.
> Handle null as input to window function NTILE
> ----------------------------------------------
>
> Key: DRILL-3647
> URL: https://issues.apache.org/jira/browse/DRILL-3647
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 1.2.0
> Environment: private-branch
> https://github.com/adeneche/incubator-drill/tree/new-window-funcs
> Reporter: Khurram Faraaz
> Assignee: Deneche A. Hakim
> Labels: window_function
> Fix For: 1.2.0
>
>
> We need to handle null as input to window functions. NTILE function must
> return null as output when input is null.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select col7 , col0 , ntile(null) over(partition
> by col7 order by col0) lead_col0 from FEWRWSPQQ_101;
> Error: PARSE ERROR: From line 1, column 22 to line 1, column 37: Argument to
> function 'NTILE' must not be NULL
> [Error Id: e5e69582-8502-4a99-8ba1-dffdfb8ac028 on centos-04.qa.lab:31010]
> (state=,code=0)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select col7 , col0 , lead(null) over(partition
> by col7 order by col0) lead_col0 from FEWRWSPQQ_101;
> Error: PARSE ERROR: From line 1, column 27 to line 1, column 30: Illegal use
> of 'NULL'
> [Error Id: 6824ca01-e3f1-4338-b4c8-5535e7a42e13 on centos-04.qa.lab:31010]
> (state=,code=0)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)