2021-09-12 12:35:27 +00:00
|
|
|
-- Tags: distributed
|
|
|
|
|
2020-03-27 20:12:14 +00:00
|
|
|
DROP TABLE IF EXISTS d_one;
|
2020-04-01 14:21:37 +00:00
|
|
|
CREATE TABLE d_one (dummy UInt8) ENGINE = Distributed(test_cluster_two_shards, system, one, rand());
|
2020-03-27 20:12:14 +00:00
|
|
|
|
|
|
|
SELECT 'local_0', toUInt8(1) AS dummy FROM system.one AS o WHERE o.dummy = 0;
|
|
|
|
SELECT 'local_1', toUInt8(1) AS dummy FROM system.one AS o WHERE o.dummy = 1;
|
|
|
|
|
|
|
|
SELECT 'distributed_0', _shard_num, toUInt8(1) AS dummy FROM d_one AS o WHERE o.dummy = 0 ORDER BY _shard_num;
|
|
|
|
SELECT 'distributed_1', _shard_num, toUInt8(1) AS dummy FROM d_one AS o WHERE o.dummy = 1 ORDER BY _shard_num;
|
|
|
|
|
|
|
|
SET distributed_product_mode = 'local';
|
|
|
|
|
|
|
|
SELECT 'local_0', toUInt8(1) AS dummy FROM system.one AS o WHERE o.dummy = 0;
|
|
|
|
SELECT 'local_1', toUInt8(1) AS dummy FROM system.one AS o WHERE o.dummy = 1;
|
|
|
|
|
|
|
|
SELECT 'distributed_0', _shard_num, toUInt8(1) AS dummy FROM d_one AS o WHERE o.dummy = 0 ORDER BY _shard_num;
|
|
|
|
SELECT 'distributed_1', _shard_num, toUInt8(1) AS dummy FROM d_one AS o WHERE o.dummy = 1 ORDER BY _shard_num;
|
|
|
|
|
|
|
|
DROP TABLE d_one;
|
2020-04-01 14:21:37 +00:00
|
|
|
|
|
|
|
SELECT 'remote_0', toUInt8(1) AS dummy FROM remote('127.0.0.2', system, one) AS o WHERE o.dummy = 0;
|
|
|
|
SELECT 'remote_1', toUInt8(1) AS dummy FROM remote('127.0.0.2', system, one) AS o WHERE o.dummy = 1;
|