mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Test for replicated MT
This commit is contained in:
parent
eec7ae2873
commit
b67947cbae
@ -0,0 +1,6 @@
|
||||
1
|
||||
CREATE TABLE default.table_for_rename_replicated (`date` Date, `key` UInt64, `value1` String, `value2` String, `value3` String) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/table_for_rename_replicaed\', \'1\') PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.table_for_rename_replicated (`date` Date, `key` UInt64, `renamed_value1` String, `value2` String, `value3` String) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/table_for_rename_replicaed\', \'1\') PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192
|
||||
1
|
||||
date key renamed_value1 value2 value3
|
||||
2019-10-02 1 1 1 1
|
@ -0,0 +1,37 @@
|
||||
DROP TABLE IF EXISTS table_for_rename_replicated;
|
||||
|
||||
|
||||
CREATE TABLE table_for_rename_replicated
|
||||
(
|
||||
date Date,
|
||||
key UInt64,
|
||||
value1 String,
|
||||
value2 String,
|
||||
value3 String
|
||||
)
|
||||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/table_for_rename_replicaed', '1')
|
||||
PARTITION BY date
|
||||
ORDER BY key;
|
||||
|
||||
|
||||
INSERT INTO table_for_rename_replicated SELECT toDate('2019-10-01') + number % 3, number, toString(number), toString(number), toString(number) from numbers(9);
|
||||
|
||||
SELECT value1 FROM table_for_rename_replicated WHERE key = 1;
|
||||
|
||||
SYSTEM STOP MERGES;
|
||||
|
||||
SHOW CREATE TABLE table_for_rename_replicated;
|
||||
|
||||
ALTER TABLE table_for_rename_replicated RENAME COLUMN value1 to renamed_value1 SETTINGS replication_alter_partitions_sync = 0;
|
||||
|
||||
SELECT sleep(2) FORMAT Null;
|
||||
|
||||
SHOW CREATE TABLE table_for_rename_replicated;
|
||||
|
||||
SELECT renamed_value1 FROM table_for_rename_replicated WHERE key = 1;
|
||||
|
||||
SELECT * FROM table_for_rename_replicated WHERE key = 1 FORMAT TSVWithNames;
|
||||
|
||||
SYSTEM START MERGES;
|
||||
|
||||
DROP TABLE IF EXISTS table_for_rename_replicated;
|
Loading…
Reference in New Issue
Block a user