ClickHouse/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql

25 lines
708 B
MySQL
Raw Normal View History

2019-05-10 21:13:50 +00:00
-- check ALTER MODIFY COLUMN with partitions
SET send_logs_level = 'none';
2019-06-07 15:41:24 +00:00
DROP TABLE IF EXISTS alter_column;
2019-05-10 21:13:50 +00:00
2019-06-07 15:41:24 +00:00
CREATE TABLE alter_column(x UInt32, y Int32) ENGINE MergeTree PARTITION BY x ORDER BY x;
INSERT INTO alter_column (x, y) SELECT number AS x, -number AS y FROM system.numbers LIMIT 50;
2019-05-10 21:13:50 +00:00
SELECT '*** Check SHOW CREATE TABLE ***';
2019-06-07 15:41:24 +00:00
SHOW CREATE TABLE alter_column;
2019-05-10 21:13:50 +00:00
SELECT '*** Check parts ***';
2019-06-07 15:41:24 +00:00
SELECT * FROM alter_column ORDER BY _part;
2019-05-10 21:13:50 +00:00
2019-06-07 15:41:24 +00:00
ALTER TABLE alter_column MODIFY COLUMN y Int64;
2019-05-10 21:13:50 +00:00
SELECT '*** Check SHOW CREATE TABLE after ALTER MODIFY ***';
2019-06-07 15:41:24 +00:00
SHOW CREATE TABLE alter_column;
2019-05-10 21:13:50 +00:00
SELECT '*** Check parts after ALTER MODIFY ***';
2019-06-07 15:41:24 +00:00
SELECT * FROM alter_column ORDER BY _part;
2019-05-10 21:13:50 +00:00
2019-06-07 15:41:24 +00:00
DROP TABLE alter_column;