ClickHouse/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

25 lines
708 B
SQL

-- check ALTER MODIFY COLUMN with partitions
SET send_logs_level = 'none';
DROP TABLE IF EXISTS alter_column;
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;
SELECT '*** Check SHOW CREATE TABLE ***';
SHOW CREATE TABLE alter_column;
SELECT '*** Check parts ***';
SELECT * FROM alter_column ORDER BY _part;
ALTER TABLE alter_column MODIFY COLUMN y Int64;
SELECT '*** Check SHOW CREATE TABLE after ALTER MODIFY ***';
SHOW CREATE TABLE alter_column;
SELECT '*** Check parts after ALTER MODIFY ***';
SELECT * FROM alter_column ORDER BY _part;
DROP TABLE alter_column;