2018-10-15 10:31:24 +00:00
|
|
|
SET send_logs_level = 'none';
|
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
DROP TABLE IF EXISTS quorum1;
|
|
|
|
DROP TABLE IF EXISTS quorum2;
|
2018-10-15 10:31:24 +00:00
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
CREATE TABLE quorum1(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '1') ORDER BY x PARTITION BY y;
|
|
|
|
CREATE TABLE quorum2(x UInt32, y Date) ENGINE ReplicatedMergeTree('/clickhouse/tables/test/quorum', '2') ORDER BY x PARTITION BY y;
|
2018-10-15 10:31:24 +00:00
|
|
|
|
|
|
|
SET insert_quorum=2;
|
|
|
|
SET select_sequential_consistency=1;
|
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
INSERT INTO quorum1 VALUES (1, '2018-11-15');
|
|
|
|
INSERT INTO quorum1 VALUES (2, '2018-11-15');
|
2018-10-15 10:31:24 +00:00
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
SELECT x FROM quorum1 ORDER BY x;
|
|
|
|
SELECT x FROM quorum2 ORDER BY x;
|
2018-10-15 10:31:24 +00:00
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
OPTIMIZE TABLE quorum1 PARTITION '2018-11-15' FINAL;
|
2018-10-18 14:14:07 +00:00
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
SELECT count(*) FROM system.parts WHERE active AND database = currentDatabase() AND table='quorum1';
|
2018-10-18 14:14:07 +00:00
|
|
|
|
2019-06-07 14:59:41 +00:00
|
|
|
DROP TABLE IF EXISTS quorum1;
|
|
|
|
DROP TABLE IF EXISTS quorum2;
|