2021-09-12 12:35:27 +00:00
|
|
|
-- Tags: distributed
|
|
|
|
|
2021-04-16 13:16:11 +00:00
|
|
|
DROP TABLE IF EXISTS data;
|
|
|
|
CREATE TABLE data (a Int64, b Int64) ENGINE = TinyLog();
|
2021-04-16 13:01:53 +00:00
|
|
|
|
2021-04-16 13:16:11 +00:00
|
|
|
DROP TABLE IF EXISTS data_distributed;
|
2021-04-20 13:31:10 +00:00
|
|
|
CREATE TABLE data_distributed (a Int64, b Int64) ENGINE = Distributed(test_shard_localhost, currentDatabase(), 'data');
|
2021-04-16 13:01:53 +00:00
|
|
|
|
2021-04-16 13:16:11 +00:00
|
|
|
INSERT INTO data VALUES (0, 0);
|
2021-04-16 13:01:53 +00:00
|
|
|
|
|
|
|
SET prefer_localhost_replica = 1;
|
2021-04-16 13:16:11 +00:00
|
|
|
SELECT a / (SELECT sum(number) FROM numbers(10)) FROM data_distributed;
|
2021-04-20 10:32:52 +00:00
|
|
|
SELECT a < (SELECT 1) FROM data_distributed;
|
2021-04-16 13:01:53 +00:00
|
|
|
|
|
|
|
SET prefer_localhost_replica = 0;
|
2021-04-16 13:16:11 +00:00
|
|
|
SELECT a / (SELECT sum(number) FROM numbers(10)) FROM data_distributed;
|
2021-04-20 10:32:52 +00:00
|
|
|
SELECT a < (SELECT 1) FROM data_distributed;
|
2021-04-16 13:01:53 +00:00
|
|
|
|
2021-04-16 13:16:11 +00:00
|
|
|
DROP TABLE data_distributed;
|
|
|
|
DROP TABLE data;
|