mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Adding stateless test for alter rename column on a distributed table.
This commit is contained in:
parent
abe28968f4
commit
6d071c430e
@ -0,0 +1,4 @@
|
||||
2020-01-01 hello
|
||||
2020-01-01 hello
|
||||
2020-01-02 hello2
|
||||
2020-01-02 hello2
|
@ -0,0 +1,17 @@
|
||||
DROP TABLE IF EXISTS visits;
|
||||
DROP TABLE IF EXISTS visits_dist;
|
||||
|
||||
CREATE TABLE visits(StartDate Date, Name String) ENGINE MergeTree ORDER BY(StartDate);
|
||||
CREATE TABLE visits_dist AS visits ENGINE Distributed(test_cluster_two_shards_localhost, currentDatabase(), 'visits', rand());
|
||||
|
||||
INSERT INTO visits_dist (StartDate, Name) VALUES ('2020-01-01', 'hello');
|
||||
INSERT INTO visits_dist (StartDate, Name) VALUES ('2020-01-02', 'hello2');
|
||||
|
||||
ALTER TABLE visits RENAME COLUMN Name TO Name2;
|
||||
ALTER TABLE visits_dist RENAME COLUMN Name TO Name2;
|
||||
|
||||
SELECT * FROM visits_dist ORDER BY StartDate, Name2;
|
||||
|
||||
DROP TABLE visits;
|
||||
DROP TABLE visits_dist;
|
||||
|
Loading…
Reference in New Issue
Block a user