[MCOL-3785] CTAS (Create Table as Select) with COUNT() ... FROM ... GROUP BY ... throws syntax error Created: 2020-02-11  Updated: 2021-02-05  Resolved: 2021-01-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: DDLProc
Affects Version/s: 1.4, 1.5.3
Fix Version/s: 5.5.2

Type: Bug Priority: Minor
Reporter: susil.behera Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-4504 DDL parser does not allow escaped qou... Open
relates to MCOL-128 ALTER TABLE conversion to columnstore... Closed
Sprint: 2021-1, 2021-2

 Description   

Build tested: 1.4.3-1
OS: centos 7
Stack: single server

CREATE TABLE ... ENGINE=columnstore AS SELECT ...COUNT() ... FROM ... GROUP BY ... throws syntax error.

MariaDB [db1]> SELECT version();
-------------------

version()

-------------------

10.4.12-6-MariaDB

-------------------
1 row in set (0.000 sec)

MariaDB [db1]> CREATE TABLE src (c0 int, c1 int);
Query OK, 0 rows affected (0.016 sec)

MariaDB [db1]> INSERT INTO src VALUES (1,1),(1,1),(1,1),(2,2),(2,2),(2,2),(3,3),(3,3),(3,3);
Query OK, 9 rows affected (0.005 sec)
Records: 9 Duplicates: 0 Warnings: 0

MariaDB [db1]> CREATE TABLE tgt1 AS SELECT c0, count(c0) FROM src GROUP BY c0;
Query OK, 3 rows affected (0.020 sec)
Records: 3 Duplicates: 0 Warnings: 0

MariaDB [db1]> SELECT * FROM tgt1;
---------------+

c0 count(c0)

---------------+

1 3
2 3
3 3

---------------+
3 rows in set (0.001 sec)

MariaDB [db1]> CREATE TABLE tgt2 engine = columnstore AS SELECT c0, count(c0) FROM src GROUP BY c0;
ERROR 1178 (42000): The storage engine for the table doesn't support The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.
MariaDB [db1]>



 Comments   
Comment by Roman [ 2020-03-06 ]

There is a feature request issue for this.

Comment by Roman [ 2020-03-26 ]

The feature from the linked issue doesn't cover this corner case.

Comment by Daniel Lee (Inactive) [ 2021-01-25 ]

Build verified: 5.5.2 (b1552)

The issue mentioned in the description has been fixed

Generated at Thu Feb 08 02:45:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.