diff --git a/tests/queries/0_stateless/01235_live_view_over_distributed.reference b/tests/queries/0_stateless/01235_live_view_over_distributed.reference new file mode 100644 index 00000000000..00fc99d96ba --- /dev/null +++ b/tests/queries/0_stateless/01235_live_view_over_distributed.reference @@ -0,0 +1,4 @@ +2020-01-01 +2020-01-01 +2020-01-02 +2020-01-02 diff --git a/tests/queries/0_stateless/01235_live_view_over_distributed.sql b/tests/queries/0_stateless/01235_live_view_over_distributed.sql new file mode 100644 index 00000000000..f3950c16002 --- /dev/null +++ b/tests/queries/0_stateless/01235_live_view_over_distributed.sql @@ -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; + diff --git a/tests/queries/0_stateless/01236_distributed_over_live_view_over_distributed.reference b/tests/queries/0_stateless/01236_distributed_over_live_view_over_distributed.reference new file mode 100644 index 00000000000..dfb4d0552f5 --- /dev/null +++ b/tests/queries/0_stateless/01236_distributed_over_live_view_over_distributed.reference @@ -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 diff --git a/tests/queries/0_stateless/01236_distributed_over_live_view_over_distributed.sql b/tests/queries/0_stateless/01236_distributed_over_live_view_over_distributed.sql new file mode 100644 index 00000000000..4408880ec5f --- /dev/null +++ b/tests/queries/0_stateless/01236_distributed_over_live_view_over_distributed.sql @@ -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; + diff --git a/tests/queries/0_stateless/01237_live_view_over_distributed_with_subquery_select_table_alias.reference b/tests/queries/0_stateless/01237_live_view_over_distributed_with_subquery_select_table_alias.reference new file mode 100644 index 00000000000..00fc99d96ba --- /dev/null +++ b/tests/queries/0_stateless/01237_live_view_over_distributed_with_subquery_select_table_alias.reference @@ -0,0 +1,4 @@ +2020-01-01 +2020-01-01 +2020-01-02 +2020-01-02 diff --git a/tests/queries/0_stateless/01237_live_view_over_distributed_with_subquery_select_table_alias.sql b/tests/queries/0_stateless/01237_live_view_over_distributed_with_subquery_select_table_alias.sql new file mode 100644 index 00000000000..dc57e001122 --- /dev/null +++ b/tests/queries/0_stateless/01237_live_view_over_distributed_with_subquery_select_table_alias.sql @@ -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; +