ClickHouse/tests/queries/0_stateless/01274_alter_rename_column_distributed.sql
Ivan be831d09f7
Update Pytest check (#18972)
* [WIP]

* Update skip-list

* Update ci_config.json

* Do not sync inserts for test

* Fix more tests

* Fix another test

* Enable one more test

* More fixed tests

* More test fixes

* Do not absolutize server path for now

* More test fixes

* Unset CLICKHOUSE_LOG_COMMENT where necessary

* Remove debugging set -e

* Fix more tests

* Fix test reference

* Fix style check
2021-02-10 21:09:13 +03:00

20 lines
664 B
SQL

set insert_distributed_sync = 1;
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;