Improve installation procedure and reduce SQL limitations (MCOL-3686)

[MCOL-3349] CTAS (Create Table as Select) Created: 2019-05-31  Updated: 2020-02-11  Resolved: 2020-02-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 1.4.3

Type: Sub-Task Priority: Major
Reporter: Todd Stoffel (Inactive) Assignee: susil.behera
Resolution: Fixed Votes: 1
Labels: None

Sprint: 2020-1, 2020-2, 2020-4, 2020-5, 2020-6, 2020-7

 Description   

Add capability to create table in ColumnStore as a select.

CREATE TABLE test2 ENGINE=columnstore AS
SELECT *
FROM test;



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2020-01-21 ]

Committed along with fixes for MCOL-128

Comment by susil.behera [ 2020-02-11 ]

Build verified: 1.4.3-1 source
server
commit 9bd5e14f4de1402c6cd4a3f81564887c1213c9e1
engine
commit 5efa6a4dc52129be2de49fdfc23e44020401b86b

Test cases:
1.
DROP DATABASE IF EXISTS db1;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (c1 int, c2 int, PRIMARY KEY (c1)) ;
CREATE TABLE db1.t4 ENGINE=columnstore SELECT * FROM db1.t1;
CREATE TABLE db1.t5 ENGINE="columnstore" SELECT * FROM db1.t1;
CREATE TABLE db1.t3 ENGINE=columnstore AS (SELECT * FROM db1.t1);
CREATE TABLE db1.t6 ENGINE=columnstore AS SELECT c1 AS c11 FROM db1.t1;
CREATE TABLE db1.t7 ENGINE=columnstore AS (SELECT c1 AS c11 FROM db1.t1);
CREATE TABLE db1.t8 ENGINE=columnstore SELECT c1 AS c11 FROM db1.t1;

2.
DROP DATABASE IF EXISTS db1;
CREATE DATABASE db1;
USE db1;
CREATE TABLE src (c0 int, c1 int);
INSERT INTO src VALUES (1,1),(1,1),(1,1),(2,2),(2,2),(2,2),(3,3),(3,3),(3,3);

CREATE TABLE tgt2 engine = columnstore AS SELECT c0, c1 FROM src GROUP BY c0 HAVING COUNT > 1;
CREATE TABLE tgt3 SELECT c0, c1 FROM src order by c0 limit 2 offset 1;
CREATE TABLE tgt4 SELECT distinct c0 FROM src;
CREATE TABLE tgt5 as (SELECT c0 FROM src where c0 > 0);
CREATE TABLE tgt6 (c2 bigint primary key) SELECT distinct c0 as c2 FROM src;

3.
DROP DATABASE IF EXISTS db1;
CREATE DATABASE db1;
USE db1;
CREATE TABLE src (c0 char(20));
INSERT INTO src VALUES ('android'),('iphone');
CREATE TABLE tgt2 (field1 int) engine=columnstore SELECT c0 FROM src;
CREATE TABLE tgt3 (field1 varchar(20), c0 char(20)) engine=columnstore SELECT * FROM src;
CREATE TABLE tgt5 engine = columnstore SELECT c0 FROM src WHERE c0='iphone';

There are some remote cases where the behavior is different from InnoDB. I'll raise tickets separately for those.

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