mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Adding some live view over distributed stateless tests.
This commit is contained in:
parent
201c65f49b
commit
442446fbfa
@ -0,0 +1,4 @@
|
||||
2020-01-01
|
||||
2020-01-01
|
||||
2020-01-02
|
||||
2020-01-02
|
@ -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;
|
||||
|
@ -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
|
@ -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;
|
||||
|
@ -0,0 +1,4 @@
|
||||
2020-01-01
|
||||
2020-01-01
|
||||
2020-01-02
|
||||
2020-01-02
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user