2021-09-12 12:35:27 +00:00
|
|
|
|
-- Tags: distributed
|
|
|
|
|
|
2021-08-13 15:27:19 +00:00
|
|
|
|
DROP TABLE IF EXISTS click_storage;
|
|
|
|
|
DROP TABLE IF EXISTS click_storage_dst;
|
|
|
|
|
|
2021-08-16 14:44:41 +00:00
|
|
|
|
CREATE TABLE click_storage ( `PhraseID` UInt64, `PhraseProcessedID` UInt64 ALIAS if(PhraseID > 5, PhraseID, 0) ) ENGINE = MergeTree() ORDER BY tuple();
|
|
|
|
|
INSERT INTO click_storage SELECT number AS PhraseID from numbers(10);
|
2021-08-13 15:27:19 +00:00
|
|
|
|
|
|
|
|
|
CREATE TABLE click_storage_dst ( `PhraseID` UInt64, `PhraseProcessedID` UInt64 ) ENGINE = Distributed(test_shard_localhost, currentDatabase(), 'click_storage');
|
|
|
|
|
|
2021-08-16 14:44:41 +00:00
|
|
|
|
SET prefer_localhost_replica = 1;
|
|
|
|
|
SELECT materialize(PhraseProcessedID) FROM click_storage_dst;
|
|
|
|
|
|
|
|
|
|
SET prefer_localhost_replica = 0;
|
2021-08-13 15:27:19 +00:00
|
|
|
|
SELECT materialize(PhraseProcessedID) FROM click_storage_dst;
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS click_storage;
|
|
|
|
|
DROP TABLE IF EXISTS click_storage_dst;
|