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

27 lines
731 B
MySQL
Raw Normal View History

2021-09-12 12:35:27 +00:00
-- Tags: no-parallel
2019-05-10 21:13:50 +00:00
-- check ALTER MODIFY COLUMN with partitions
2020-06-20 11:29:01 +00:00
SET send_logs_level = 'fatal';
2019-05-10 21:13:50 +00:00
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;