[MCOL-1201] Allow UDAnF to have multiple parameters defined. Created: 2018-02-05 Updated: 2018-10-11 Resolved: 2018-10-11 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr, MDB Plugin, PrimProc |
| Affects Version/s: | 1.1.2 |
| Fix Version/s: | 1.2.0 |
| Type: | New Feature | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2018-08, 2018-09, 2018-10, 2018-11, 2018-12, 2018-13, 2018-14, 2018-15, 2018-16, 2018-17, 2018-18 | ||||||||
| Description |
|
UDAF in 1.1 allows for only one parameter to be defined. This JIRA is to allow for multiple parameters to be defined. In addition, some of these parameters (only trailing ones) may be optional. |
| Comments |
| Comment by David Hall (Inactive) [ 2018-07-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
To test, use the function regr_avgx, which has been included as a test function. regr_avgx(y,x) takes two arguments. The x argument must be numeric. It should error out if it is not. The y can be anything. This function should also work with constants in either position. It should error if it gets the wrong number of arguments. If regr_avgx() shows as not a function then, it must be created: It works just like avg() and should be able to pass any test avg() can do. The difference is, if y OR x is NULL, the x value is not considered as part of the avg. regr_avgx() doesn't fully test the capabilities of this feature. It will be further tested as part of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2018-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build tested: Github source /root/columnstore/mariadb-columnstore-server /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine For now, I am just testing the regr_avgx function that's built into the distribution, The following test seemed to be working fine with ColumnStore tables, except that the result returned as decimal values, instead of integer values. MariaDB [mytest]> create table TestTable ( MariaDB [mytest]> select * from TestTable;
-----
----- MariaDB [mytest]> SELECT REGR_AVGX(y, x) FROM TestTable;
-----------------
----------------- MariaDB [mytest]> SELECT REGR_AVGX(x,y) FROM TestTable;
----------------
---------------- MariaDB [mytest]> insert into TestTable values (10, NULL ); MariaDB [mytest]> select * from TestTable;
-----
----- MariaDB [mytest]> SELECT REGR_AVGX(y, x) FROM TestTable;
-----------------
----------------- MariaDB [mytest]> SELECT REGR_AVGX(x,y) FROM TestTable;
----------------
---------------- MariaDB [mytest]> insert into TestTable values (NULL, 94 ); MariaDB [mytest]> select * from TestTable;
-----
----- MariaDB [mytest]> SELECT REGR_AVGX(y, x) FROM TestTable;
-----------------
----------------- MariaDB [mytest]> SELECT REGR_AVGX(x, y) FROM TestTable;
-----------------
----------------- MariaDB [mytest]> insert into TestTable values (NULL, NULL ); MariaDB [mytest]> select * from TestTable;
-----
----- MariaDB [mytest]> SELECT REGR_AVGX(y, x) FROM TestTable;
-----------------
----------------- MariaDB [mytest]> SELECT REGR_AVGX(x, y) FROM TestTable;
-----------------
----------------- For InnoDB tables, the function caused mysqld to crash when column values are NULL. MariaDB [mytest]> create table TestTable ( .
-----
----- MariaDB [mytest]> SELECT REGR_AVGX(x,y) FROM TestTable; ERROR 2013 (HY000): Lost connection to MySQL server during query | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2018-10-10 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tested with 1000 columns UDAF:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2018-10-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 1.2 source /root/columnstore/mariadb-columnstore-server Merge pull request #134 from mariadb-corporation/versionCmakeFix port changes for mysql_version cmake to fix columnstore RPM packaging /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine Merge pull request #588 from mariadb-corporation/ The mysqld crashing issue has been fixed. |