[MCOL-74] Nth_value() windowing function does not exist error Created: 2016-05-23 Updated: 2016-10-11 Resolved: 2016-10-06 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | None |
| Fix Version/s: | 1.0.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Daniel Lee (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | relnote | ||
| Sprint: | 2016-19 |
| Description |
|
Build tested: InfiniDB> getcalpontsoft Name : infinidb-platform Relocations: (not relocatable) the Nth_value() function was working in earlier build of ColumnStore, although the returned result was incorrect(There is an bug opened for this incorrect result issue). Now this function no longer exists in the build. |
| Comments |
| Comment by Daniel Lee (Inactive) [ 2016-05-23 ] | |
|
MariaDB [tpch1m]> select o_custkey, Nth_value(o_custkey,2) OVER (PARTITION BY abs(o_custkey)+10 ORDER BY o_custkey DESC NULLS LAST ,o_orderkey DESC NULLS LAST ,o_orderdate DESC NULLS LAST ROWS BETWEEN 15 FOLLOWING AND 15 FOLLOWING) from (select * from orders where o_custkey <= 20000) s; | |
| Comment by David Hall (Inactive) [ 2016-06-02 ] | |
|
Here's a list of the test queries that failed. This list also includes last_value: Compare failed - working_tpch1_compareLogOnly/windowFunctions/bug5777.sql | |
| Comment by David Hall (Inactive) [ 2016-09-28 ] | |
|
NTH_VALUE was listed in func_array_nulls of item_create_window_function.cc, but not in func_array. If you add ignore nulls in the proper place, it works. Added NTH_VALUE to func_array. So, why does this work in InfininDB? I checked and the code is the same. Anyway, adding it fixed the issue. | |
| Comment by David Hall (Inactive) [ 2016-09-28 ] | |
|
This bug fix only fixes the syntax error. It does not address any incorrect results, if any, as defined in | |
| Comment by David Hall (Inactive) [ 2016-09-29 ] | |
|
First, the above fix is incorrect. There is a line missing in lex.h that got left behind in the InfiniDB port to MariaDB. While working this, I noticed that the phrase FROM FIRST | LAST causes syntax error. This worked in InfiniDB. The cause is a conflict with the way MariaDB parses the FROM clause of SELECT and others. The new sql_yacc.yy contains this: from_clause: opt_from_clause:
This did not exist in mysql 5.1.73 – another mechanism was used that did not conflict. A change in the columnstore NTH_VALUE rules to explicitly demand the FROM FIRST, FROM LAST and no FROM clause fixes the issue. | |
| Comment by Andrew Hutchings (Inactive) [ 2016-09-29 ] | |
|
Good fix! Moving to testing | |
| Comment by Daniel Lee (Inactive) [ 2016-10-06 ] | |
|
Build verified: 1.0.4-1 Name : mariadb-columnstore-platform |