2021-09-12 12:35:27 +00:00
|
|
|
-- Tags: distributed, no-replicated-database, no-parallel, no-fasttest
|
|
|
|
|
2021-02-10 18:09:13 +00:00
|
|
|
set insert_distributed_sync = 1;
|
2020-04-10 16:04:25 +00:00
|
|
|
SET allow_experimental_live_view = 1;
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS lv;
|
|
|
|
DROP TABLE IF EXISTS visits;
|
|
|
|
DROP TABLE IF EXISTS visits_layer;
|
|
|
|
|
|
|
|
CREATE TABLE visits(StartDate Date) ENGINE MergeTree ORDER BY(StartDate);
|
|
|
|
CREATE TABLE visits_layer(StartDate Date) ENGINE Distributed(test_cluster_two_shards_localhost, currentDatabase(), 'visits', rand());
|
|
|
|
|
2021-02-10 18:09:13 +00:00
|
|
|
CREATE LIVE VIEW lv AS SELECT * FROM visits_layer ORDER BY StartDate;
|
2020-04-10 16:04:25 +00:00
|
|
|
|
|
|
|
INSERT INTO visits_layer (StartDate) VALUES ('2020-01-01');
|
|
|
|
INSERT INTO visits_layer (StartDate) VALUES ('2020-01-02');
|
|
|
|
|
|
|
|
SELECT * FROM lv;
|
|
|
|
|
|
|
|
DROP TABLE visits;
|
|
|
|
DROP TABLE visits_layer;
|
|
|
|
|
2020-05-13 00:13:45 +00:00
|
|
|
DROP TABLE lv;
|