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

Jinfeng Ni commented on DRILL-3649:
-----------------------------------

The symptom is different. But the root cause is the same : Calcite previously 
did not block window function w/o over clause(). I think Calcite-820 should fix 
both DRILL-3297 AND DRILL-3649.


> LEAD , LAG , NTILE , FIRST_VALUE , LAST_VALUE report RuntimeException for 
> missing OVER clause
> ---------------------------------------------------------------------------------------------
>
>                 Key: DRILL-3649
>                 URL: https://issues.apache.org/jira/browse/DRILL-3649
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>         Environment: private-branch 
> https://github.com/adeneche/incubator-drill/tree/new-window-funcs
>            Reporter: Khurram Faraaz
>            Assignee: Sean Hsuan-Yi Chu
>              Labels: window_function
>             Fix For: 1.2.0
>
>
> Missing OVER clause must be caught at query plan time, instead we see 
> RuntimeException.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select NTILE(1) from FEWRWSPQQ_101;
> java.lang.RuntimeException: java.sql.SQLException: SYSTEM ERROR: 
> SchemaChangeException: Failure while materializing expression. 
> Error in expression at index -1.  Error: Missing function implementation: 
> [ntile(INT-REQUIRED)].  Full expression: --UNKNOWN EXPRESSION--.
> Fragment 0:0
> [Error Id: 5f2f6ffa-7557-447e-a015-63cc87e3e543 on centos-04.qa.lab:31010]
>       at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
>       at 
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
>       at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
>       at sqlline.SqlLine.print(SqlLine.java:1583)
>       at sqlline.Commands.execute(Commands.java:852)
>       at sqlline.Commands.sql(Commands.java:751)
>       at sqlline.SqlLine.dispatch(SqlLine.java:738)
>       at sqlline.SqlLine.begin(SqlLine.java:612)
>       at sqlline.SqlLine.start(SqlLine.java:366)
>       at sqlline.SqlLine.main(SqlLine.java:259)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select FIRST_VALUE(1) from FEWRWSPQQ_101;
> java.lang.RuntimeException: java.sql.SQLException: SYSTEM ERROR: 
> SchemaChangeException: Failure while materializing expression. 
> Error in expression at index -1.  Error: Missing function implementation: 
> [first_value(INT-REQUIRED)].  Full expression: --UNKNOWN EXPRESSION--.
> Fragment 0:0
> [Error Id: cc52f460-bd85-4588-9f1c-bcf5c6e4729c on centos-04.qa.lab:31010]
>       at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
>       at 
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
>       at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
>       at sqlline.SqlLine.print(SqlLine.java:1583)
>       at sqlline.Commands.execute(Commands.java:852)
>       at sqlline.Commands.sql(Commands.java:751)
>       at sqlline.SqlLine.dispatch(SqlLine.java:738)
>       at sqlline.SqlLine.begin(SqlLine.java:612)
>       at sqlline.SqlLine.start(SqlLine.java:366)
>       at sqlline.SqlLine.main(SqlLine.java:259)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select LAST_VALUE(1) from FEWRWSPQQ_101;
> java.lang.RuntimeException: java.sql.SQLException: SYSTEM ERROR: 
> SchemaChangeException: Failure while materializing expression. 
> Error in expression at index -1.  Error: Missing function implementation: 
> [last_value(INT-REQUIRED)].  Full expression: --UNKNOWN EXPRESSION--.
> Fragment 0:0
> [Error Id: b02c7c59-f9b0-4dc5-89f8-2eb754fcd27b on centos-04.qa.lab:31010]
>       at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
>       at 
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
>       at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
>       at sqlline.SqlLine.print(SqlLine.java:1583)
>       at sqlline.Commands.execute(Commands.java:852)
>       at sqlline.Commands.sql(Commands.java:751)
>       at sqlline.SqlLine.dispatch(SqlLine.java:738)
>       at sqlline.SqlLine.begin(SqlLine.java:612)
>       at sqlline.SqlLine.start(SqlLine.java:366)
>       at sqlline.SqlLine.main(SqlLine.java:259)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select LEAD(1) from FEWRWSPQQ_101;
> java.lang.RuntimeException: java.sql.SQLException: SYSTEM ERROR: 
> CompileException: Line 89, Column 60: Unknown variable or type "index"
> Fragment 0:0
> [Error Id: c8375ab9-69ed-4f37-83a4-639d8780762e on centos-04.qa.lab:31010]
>       at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
>       at 
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
>       at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
>       at sqlline.SqlLine.print(SqlLine.java:1583)
>       at sqlline.Commands.execute(Commands.java:852)
>       at sqlline.Commands.sql(Commands.java:751)
>       at sqlline.SqlLine.dispatch(SqlLine.java:738)
>       at sqlline.SqlLine.begin(SqlLine.java:612)
>       at sqlline.SqlLine.start(SqlLine.java:366)
>       at sqlline.SqlLine.main(SqlLine.java:259)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select LAG(1) from FEWRWSPQQ_101;
> java.lang.RuntimeException: java.sql.SQLException: SYSTEM ERROR: 
> CompileException: Line 89, Column 60: Unknown variable or type "index"
> Fragment 0:0
> [Error Id: 45d65e74-680d-4332-9b91-4496e0825576 on centos-04.qa.lab:31010]
>       at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
>       at 
> sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
>       at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
>       at sqlline.SqlLine.print(SqlLine.java:1583)
>       at sqlline.Commands.execute(Commands.java:852)
>       at sqlline.Commands.sql(Commands.java:751)
>       at sqlline.SqlLine.dispatch(SqlLine.java:738)
>       at sqlline.SqlLine.begin(SqlLine.java:612)
>       at sqlline.SqlLine.start(SqlLine.java:366)
>       at sqlline.SqlLine.main(SqlLine.java:259)
> {code}



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

Reply via email to