2021-09-12 12:35:27 +00:00
|
|
|
-- Tags: no-parallel
|
|
|
|
|
2020-07-10 05:58:16 +00:00
|
|
|
DROP TABLE IF EXISTS test;
|
|
|
|
CREATE TABLE test (x UInt8) ENGINE = MergeTree ORDER BY tuple();
|
|
|
|
INSERT INTO test (x) VALUES (1), (2), (3);
|
2024-05-30 12:27:25 +00:00
|
|
|
ALTER TABLE test CLEAR COLUMN x; --{serverError BAD_ARGUMENTS}
|
2020-07-10 05:58:16 +00:00
|
|
|
DROP TABLE test;
|
2020-07-13 17:27:52 +00:00
|
|
|
|
|
|
|
DROP TABLE IF EXISTS test;
|
|
|
|
|
|
|
|
CREATE TABLE test (x UInt8, y UInt8) ENGINE = MergeTree ORDER BY tuple();
|
|
|
|
INSERT INTO test (x, y) VALUES (1, 1), (2, 2), (3, 3);
|
|
|
|
|
|
|
|
ALTER TABLE test CLEAR COLUMN x;
|
|
|
|
|
2024-05-30 12:27:25 +00:00
|
|
|
ALTER TABLE test CLEAR COLUMN x IN PARTITION ''; --{serverError INVALID_PARTITION_VALUE}
|
|
|
|
ALTER TABLE test CLEAR COLUMN x IN PARTITION 'asdasd'; --{serverError INVALID_PARTITION_VALUE}
|
|
|
|
ALTER TABLE test CLEAR COLUMN x IN PARTITION '123'; --{serverError INVALID_PARTITION_VALUE}
|
2020-07-13 17:27:52 +00:00
|
|
|
|
2024-05-30 12:27:25 +00:00
|
|
|
ALTER TABLE test CLEAR COLUMN y; --{serverError BAD_ARGUMENTS}
|
2020-07-13 17:27:52 +00:00
|
|
|
|
|
|
|
ALTER TABLE test ADD COLUMN z String DEFAULT 'Hello';
|
|
|
|
|
|
|
|
-- y is only real column in table
|
2024-05-30 12:27:25 +00:00
|
|
|
ALTER TABLE test CLEAR COLUMN y; --{serverError BAD_ARGUMENTS}
|
2020-07-13 17:27:52 +00:00
|
|
|
ALTER TABLE test CLEAR COLUMN x;
|
|
|
|
ALTER TABLE test CLEAR COLUMN z;
|
|
|
|
|
|
|
|
INSERT INTO test (x, y, z) VALUES (1, 1, 'a'), (2, 2, 'b'), (3, 3, 'c');
|
|
|
|
|
|
|
|
ALTER TABLE test CLEAR COLUMN z;
|
|
|
|
ALTER TABLE test CLEAR COLUMN x;
|
|
|
|
|
|
|
|
SELECT * FROM test ORDER BY y;
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS test;
|