mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-19 06:50:50 +00:00
80cf86f100
I guess that adding new cluster into server-test.xml is not required, but it won't harm.
43 lines
1.3 KiB
SQL
43 lines
1.3 KiB
SQL
DROP TABLE IF EXISTS local_00952;
|
|
DROP TABLE IF EXISTS distributed_00952;
|
|
|
|
--
|
|
-- insert_distributed_sync=0
|
|
--
|
|
SELECT 'insert_distributed_sync=0';
|
|
SET insert_distributed_sync=0;
|
|
|
|
CREATE TABLE local_00952 (date Date, value Date MATERIALIZED toDate('2017-08-01')) ENGINE = MergeTree(date, date, 8192);
|
|
CREATE TABLE distributed_00952 AS local_00952 ENGINE = Distributed('test_cluster_two_shards', currentDatabase(), local_00952, rand());
|
|
|
|
INSERT INTO distributed_00952 VALUES ('2018-08-01');
|
|
SYSTEM FLUSH DISTRIBUTED distributed_00952;
|
|
|
|
SELECT * FROM distributed_00952;
|
|
SELECT date, value FROM distributed_00952;
|
|
SELECT * FROM local_00952;
|
|
SELECT date, value FROM local_00952;
|
|
|
|
DROP TABLE distributed_00952;
|
|
DROP TABLE local_00952;
|
|
|
|
--
|
|
-- insert_distributed_sync=1
|
|
--
|
|
SELECT 'insert_distributed_sync=1';
|
|
SET insert_distributed_sync=1;
|
|
|
|
CREATE TABLE local_00952 (date Date, value Date MATERIALIZED toDate('2017-08-01')) ENGINE = MergeTree(date, date, 8192);
|
|
CREATE TABLE distributed_00952 AS local_00952 ENGINE = Distributed('test_cluster_two_shards', currentDatabase(), local_00952, rand());
|
|
|
|
INSERT INTO distributed_00952 VALUES ('2018-08-01');
|
|
|
|
SELECT * FROM distributed_00952;
|
|
SELECT date, value FROM distributed_00952;
|
|
SELECT * FROM local_00952;
|
|
SELECT date, value FROM local_00952;
|
|
|
|
DROP TABLE distributed_00952;
|
|
DROP TABLE local_00952;
|
|
|