2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS alter;
|
|
|
|
CREATE TABLE alter (d Date, x UInt8) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/alter', 'r1', d, (d), 8192);
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO alter VALUES ('2014-01-01', 1);
|
|
|
|
ALTER TABLE alter DROP COLUMN x;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2017-06-25 02:31:53 +00:00
|
|
|
SELECT value FROM system.zookeeper WHERE path = '/clickhouse/tables/test/alter/replicas/r1/parts/20140101_20140101_0_0_0' AND name = 'columns' FORMAT TabSeparatedRaw;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE alter;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE alter (d Date) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/alter', 'r1', d, (d), 8192);
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO alter VALUES ('2014-01-01');
|
|
|
|
SELECT * FROM alter ORDER BY d;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
ALTER TABLE alter ADD COLUMN x UInt8;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO alter VALUES ('2014-02-01', 1);
|
|
|
|
SELECT * FROM alter ORDER BY d;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
ALTER TABLE alter DROP COLUMN x;
|
|
|
|
SELECT * FROM alter ORDER BY d;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2017-06-25 02:31:53 +00:00
|
|
|
SELECT value FROM system.zookeeper WHERE path = '/clickhouse/tables/test/alter/replicas/r1/parts/20140201_20140201_0_0_0' AND name = 'columns' FORMAT TabSeparatedRaw;
|
2015-02-01 03:49:36 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE alter;
|