Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.6.0
-
None
-
None
Description
We need to report a proper error message to user when window frame exclusion is used in the window frame-clause. Currently we do not support it and the current error message is not helpful.
Drill 1.6.0
commit ID: 6d5f4983
0: jdbc:drill:schema=dfs.tmp> select count(*) OVER(PARTITION BY CAST(columns[0] as integer) ORDER BY cast(columns[0] as integer) RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED following EXCLUDE CURRENT ROW) from dfs.tmp.`t_alltype.csv`; Error: PARSE ERROR: Encountered "EXCLUDE" at line 1, column 158. Was expecting one of: ")" ... "ALLOW" ... "DISALLOW" ... while parsing SQL query: select count(*) OVER(PARTITION BY CAST(columns[0] as integer) ORDER BY cast(columns[0] as integer) RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED following EXCLUDE CURRENT ROW) from dfs.tmp.`t_alltype.csv` ^ [Error Id: ddfcd7fc-1a84-4e1f-8e51-34601e9155a6 on centos-04.qa.lab:31010] (state=,code=0)
From the SQL specification, we need to add these.
<window frame exclusion> ::= EXCLUDE CURRENT ROW | EXCLUDE GROUP | EXCLUDE TIES | EXCLUDE NO OTHERS