Skip to content

[Bug] create table like when having sequence column #10463

@nextdreamblue

Description

@nextdreamblue

Search before asking

  • I had searched in the issues and found no similar issues.

Version

master

What's Wrong?

When i create table A like B which has sequence column, i do not get table A with sequence column.

What You Expected?

I want get table A with sequence column.

How to Reproduce?

Reproduce it like this:

MySQL [test]> CREATE TABLE table_a
-> (
-> k1 BIGINT,
-> k2 LARGEINT,
-> v1 VARCHAR(2048),
-> v2 SMALLINT DEFAULT "10"
-> )
-> UNIQUE KEY(k1)
-> DISTRIBUTED BY HASH (k1) BUCKETS 32
-> PROPERTIES(
-> "replication_num" = "1",
-> "function_column.sequence_type" = 'LARGEINT'
-> );
Query OK, 0 rows affected (0.06 sec)

MySQL [test]> show create table table_a;
+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| table_a | CREATE TABLE table_a (
k1 bigint(20) NULL COMMENT "",
k2 largeint(40) NULL COMMENT "",
v1 varchar(2048) NULL COMMENT "",
v2 smallint(6) NULL DEFAULT "10" COMMENT ""
) ENGINE=OLAP
UNIQUE KEY(k1)
COMMENT "OLAP"
DISTRIBUTED BY HASH(k1) BUCKETS 32
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
) |
+---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL [test]> set show_hidden_columns=true;
Query OK, 0 rows affected (0.01 sec)

MySQL [test]> show create table table_a;
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| table_a | CREATE TABLE table_a (
k1 bigint(20) NULL COMMENT "",
k2 largeint(40) NULL COMMENT "",
v1 varchar(2048) NULL COMMENT "",
v2 smallint(6) NULL DEFAULT "10" COMMENT "",
__DORIS_DELETE_SIGN__ tinyint(4) NOT NULL DEFAULT "0" COMMENT "doris delete flag hidden column",
__DORIS_SEQUENCE_COL__ largeint(40) NULL COMMENT "sequence column hidden column"
) ENGINE=OLAP
UNIQUE KEY(k1)
COMMENT "OLAP"
DISTRIBUTED BY HASH(k1) BUCKETS 32
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
) |
+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL [test]>
MySQL [test]>
MySQL [test]> create table table_b like table_a;
Query OK, 0 rows affected (0.03 sec)

MySQL [test]> show create table table_b;
+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| table_b | CREATE TABLE table_b (
k1 bigint(20) NULL COMMENT "",
k2 largeint(40) NULL COMMENT "",
v1 varchar(2048) NULL COMMENT "",
v2 smallint(6) NULL DEFAULT "10" COMMENT "",
__DORIS_DELETE_SIGN__ tinyint(4) NOT NULL DEFAULT "0" COMMENT "doris delete flag hidden column"
) ENGINE=OLAP
UNIQUE KEY(k1)
COMMENT "OLAP"
DISTRIBUTED BY HASH(k1) BUCKETS 32
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
) |
+---------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

I can not get table_b with sequence column hidden column "DORIS_SEQUENCE_COL".

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions