mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
91 lines
2.6 KiB
Plaintext
91 lines
2.6 KiB
Plaintext
2019-10-01 0 0 1 2
|
|
2019-10-02 1 1 2 3
|
|
2019-10-03 2 2 3 4
|
|
2019-10-01 3 3 4 5
|
|
2019-10-02 4 4 5 6
|
|
2019-10-03 5 5 6 7
|
|
2019-10-01 6 6 7 8
|
|
2019-10-02 7 7 8 9
|
|
2019-10-03 8 8 9 10
|
|
CREATE TABLE default.table_for_rename\n(\n `date` Date, \n `key` UInt64, \n `value4` String, \n `value5` String, \n `value3` String, \n CONSTRAINT cs_value1 CHECK toInt64(value4) < toInt64(value5), \n CONSTRAINT cs_value2 CHECK toInt64(value5) < toInt64(value3)\n)\nENGINE = MergeTree()\nPARTITION BY date\nORDER BY key\nSETTINGS index_granularity = 8192
|
|
2019-10-01 0 0 1 2
|
|
2019-10-02 1 1 2 3
|
|
2019-10-03 2 2 3 4
|
|
2019-10-01 3 3 4 5
|
|
2019-10-02 4 4 5 6
|
|
2019-10-03 5 5 6 7
|
|
2019-10-01 6 6 7 8
|
|
2019-10-02 7 7 8 9
|
|
2019-10-03 8 8 9 10
|
|
-- insert after rename --
|
|
2019-10-01 0 0 1 2
|
|
2019-10-02 1 1 2 3
|
|
2019-10-03 2 2 3 4
|
|
2019-10-01 3 3 4 5
|
|
2019-10-02 4 4 5 6
|
|
2019-10-03 5 5 6 7
|
|
2019-10-01 6 6 7 8
|
|
2019-10-02 7 7 8 9
|
|
2019-10-03 8 8 9 10
|
|
2019-10-02 10 10 11 12
|
|
2019-10-03 11 11 12 13
|
|
2019-10-01 12 12 13 14
|
|
2019-10-02 13 13 14 15
|
|
2019-10-03 14 14 15 16
|
|
2019-10-01 15 15 16 17
|
|
2019-10-02 16 16 17 18
|
|
2019-10-03 17 17 18 19
|
|
2019-10-01 18 18 19 20
|
|
2019-10-02 19 19 20 21
|
|
-- rename columns back --
|
|
CREATE TABLE default.table_for_rename\n(\n `date` Date, \n `key` UInt64, \n `value1` String, \n `value2` String, \n `value3` String, \n CONSTRAINT cs_value1 CHECK toInt64(value1) < toInt64(value2), \n CONSTRAINT cs_value2 CHECK toInt64(value2) < toInt64(value3)\n)\nENGINE = MergeTree()\nPARTITION BY date\nORDER BY key\nSETTINGS index_granularity = 8192
|
|
2019-10-01 0 0 1 2
|
|
2019-10-02 1 1 2 3
|
|
2019-10-03 2 2 3 4
|
|
2019-10-01 3 3 4 5
|
|
2019-10-02 4 4 5 6
|
|
2019-10-03 5 5 6 7
|
|
2019-10-01 6 6 7 8
|
|
2019-10-02 7 7 8 9
|
|
2019-10-03 8 8 9 10
|
|
2019-10-02 10 10 11 12
|
|
2019-10-03 11 11 12 13
|
|
2019-10-01 12 12 13 14
|
|
2019-10-02 13 13 14 15
|
|
2019-10-03 14 14 15 16
|
|
2019-10-01 15 15 16 17
|
|
2019-10-02 16 16 17 18
|
|
2019-10-03 17 17 18 19
|
|
2019-10-01 18 18 19 20
|
|
2019-10-02 19 19 20 21
|
|
-- insert after rename column --
|
|
2019-10-01 0 0 1 2
|
|
2019-10-02 1 1 2 3
|
|
2019-10-03 2 2 3 4
|
|
2019-10-01 3 3 4 5
|
|
2019-10-02 4 4 5 6
|
|
2019-10-03 5 5 6 7
|
|
2019-10-01 6 6 7 8
|
|
2019-10-02 7 7 8 9
|
|
2019-10-03 8 8 9 10
|
|
2019-10-02 10 10 11 12
|
|
2019-10-03 11 11 12 13
|
|
2019-10-01 12 12 13 14
|
|
2019-10-02 13 13 14 15
|
|
2019-10-03 14 14 15 16
|
|
2019-10-01 15 15 16 17
|
|
2019-10-02 16 16 17 18
|
|
2019-10-03 17 17 18 19
|
|
2019-10-01 18 18 19 20
|
|
2019-10-02 19 19 20 21
|
|
2019-10-03 20 20 21 22
|
|
2019-10-01 21 21 22 23
|
|
2019-10-02 22 22 23 24
|
|
2019-10-03 23 23 24 25
|
|
2019-10-01 24 24 25 26
|
|
2019-10-02 25 25 26 27
|
|
2019-10-03 26 26 27 28
|
|
2019-10-01 27 27 28 29
|
|
2019-10-02 28 28 29 30
|
|
2019-10-03 29 29 30 31
|