Adding some live view over distributed stateless tests.

This commit is contained in:
Vitaliy Zakaznikov 2020-04-10 12:04:25 -04:00
parent 201c65f49b
commit 442446fbfa
6 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,4 @@
2020-01-01
2020-01-01
2020-01-02
2020-01-02

View File

@ -0,0 +1,19 @@
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());
CREATE LIVE VIEW lv AS SELECT * FROM visits_layer ORDER BY StartDate;
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;

View File

@ -0,0 +1,8 @@
2020-01-01
2020-01-01
2020-01-02
2020-01-02
2020-01-01
2020-01-01
2020-01-02
2020-01-02

View File

@ -0,0 +1,21 @@
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());
CREATE LIVE VIEW lv AS SELECT * FROM visits_layer ORDER BY StartDate;
CREATE TABLE visits_layer_lv(StartDate Date) ENGINE Distributed(test_cluster_two_shards_localhost, currentDatabase(), 'lv', rand());
INSERT INTO visits_layer (StartDate) VALUES ('2020-01-01');
INSERT INTO visits_layer (StartDate) VALUES ('2020-01-02');
SELECT * FROM visits_layer_lv;
DROP TABLE visits;
DROP TABLE visits_layer;

View File

@ -0,0 +1,4 @@
2020-01-01
2020-01-01
2020-01-02
2020-01-02

View File

@ -0,0 +1,19 @@
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());
CREATE LIVE VIEW lv AS SELECT foo.x FROM (SELECT StartDate AS x FROM visits_layer) AS foo ORDER BY foo.x;
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;