Details

    • Sub-Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.4.3
    • None
    • None
    • 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;

      Attachments

        Activity

          Committed along with fixes for MCOL-128

          LinuxJedi Andrew Hutchings (Inactive) added a comment - Committed along with fixes for MCOL-128
          susil.behera Susil Behera added a comment -

          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.

          susil.behera Susil Behera added a comment - 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.

          People

            susil.behera Susil Behera
            toddstoffel Todd Stoffel (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.