[MCOL-678] support "with rollup" Created: 2017-04-23 Updated: 2023-12-21 |
|
| Status: | In Testing |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | 1.0.8 |
| Fix Version/s: | 23.10.1 |
| Type: | New Feature | Priority: | Major |
| Reporter: | David Thompson (Inactive) | Assignee: | Sergey Zefirov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | rm_tpcds | ||
| Issue Links: |
|
||||||||||||
| Epic Link: | ColumnStore Compatibility Improvements | ||||||||||||
| Sprint: | 2023-8, 2023-10, 2023-11, 2023-12 | ||||||||||||
| Assigned for Review: | |
||||||||||||
| Assigned for Testing: | |
||||||||||||
| Description |
|
If you use 'with rollup' syntax then the following error is returned by default:
This can be worked around by specifying non distributed query operating mode as documented here: https://mariadb.com/kb/en/mariadb/columnstore-operating-mode/
Testing the changesThe behavior of WITH ROLLUP is the same with regard to types of rolled up GROUP BY columns. E.g., if we GROUP BY on TEXT and TEXT columns, the behavior ith regards to adding rows with NULLs should be the same as with INTEGER and INTEGER columns. The aggregates we definitely must support; MIN, MAX, SUM, AVG, COUNT (both forms). The aggregates we do not support right now: GROUP_CONCAT and JSONARRAYAGG. Any other may or may not work. |
| Comments |
| Comment by David Thompson (Inactive) [ 2017-05-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MariaDB Syntax is covered here: https://mariadb.com/kb/en/mariadb/select-with-rollup/ and should be considered the reference point for behavior / syntax. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Todd Stoffel (Inactive) [ 2022-11-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This item is being closed because it was well passed the expiration date with no activity. If you suspect this was done in error please create a new ticket. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gagan Goel (Inactive) [ 2022-12-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have reopened this ticket as this affects TPC-DS query67. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2023-09-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sergey.zefirov Could you add your suggestions for QA on how to test this feature. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kirill Perov [ 2023-10-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sergey.zefirov Found problems with union all for MCS+MDB tables: DROP DATABASE IF EXISTS mcs84_db; CREATE TABLE booksales (country CHAR(35), genre CHAR(15), year INT, sales INT) ENGINE=Columnstore; INSERT INTO booksales VALUES CREATE TABLE booksales3 (country3 CHAR(35), genre3 CHAR(15), year3 INT, sales3 INT); INSERT INTO booksales3 VALUES SELECT country, year, genre, SUM(sales) FROM booksales GROUP BY country, year, genre WITH ROLLUP UNION all SELECT country3, year3, genre3, SUM(sales3) FROM booksales3 GROUP BY country3,year3,genre3 WITH ROLLUP; returns: country year genre SUM(sales) 'normal' rows doubled by union all if both tables are MDB or both MCS - rollup rows are doubled | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kirill Perov [ 2023-10-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sergey.zefirov second problem with union of 2 MCS tables: DROP DATABASE IF EXISTS mcs84_db; CREATE TABLE booksales (country CHAR(35), genre CHAR(15), year INT, sales INT) ENGINE=Columnstore; INSERT INTO booksales VALUES CREATE TABLE booksales2 (country2 CHAR(35), genre2 CHAR(15), year2 INT, sales2 INT) ENGINE=Columnstore; INSERT INTO booksales2 VALUES select country,year,genre,sum(sales),avg(sales) from (SELECT country, year, genre, sales FROM booksales UNION all SELECT country2, year2, genre2, sales2 FROM booksales2) t1 GROUP BY country,year,genre WITH ROLLUP; returns: ---------
---------
--------- no rollup rows!!! (also no for MCS+MDB tables or MDB+MCS) (if both tables are MDB - rollup rows exist): MariaDB [mcs84_db]> select country3,year3,genre3,sum(sales3),avg(sales3) from (SELECT country3, year3, genre3, sales3 FROM booksales3 UNION all SELECT country4, year4, genre4, sales4 FROM booksales4) t1 GROUP BY country3,year3,genre3 WITH ROLLUP;
---------
--------- | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kirill Perov [ 2023-10-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
At drone CI under docker first query using two engine tables raise error: select country, year3, sum(sales3) from booksales b1 join booksales3 b3 on b1.sales=b3.sales3 group by country,year3 WITH ROLLUP; mysqltest: At line 74: query 'select country, year3, sum(sales3) from booksales b1 join booksales3 b3 on b1.sales=b3.sales3 group by country,year3 WITH ROLLUP' failed: ER_INTERNAL_ERROR (1815): Internal error: CrossEngineStep::execute() fatal error running mysql_real_connect() in libmysql_client lib (1045) (Access denied for user 'cejuser'@'localhost' (using password: YES)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2023-11-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
kirill.perov@mariadb.com The last issue description looks like there was no CrossEngineJoin user with the specific password in MDB or there was no `select flush privileges;` has been called after the user had been added. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kirill Perov [ 2023-11-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sergey.zefirov, drrtuy Yes, error in drone was resolved by adding CrossEngineJoin user. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roman [ 2023-11-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The issue with WITH ROLLUP on subselect found by kirill.perov@mariadb.com has been fixed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kirill Perov [ 2023-12-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
query with 2 MCS tables is working well |