Added a test #2282

This commit is contained in:
Alexey Milovidov 2019-09-02 22:13:12 +03:00
parent 14e16c7a41
commit 2b0af524cb
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1 @@
0000-00-00 1 bar_n_1 1

View File

@ -0,0 +1,14 @@
DROP TABLE IF EXISTS foo;
DROP TABLE IF EXISTS bar;
DROP TABLE IF EXISTS view_foo_bar;
create table foo (ddate Date, id Int64, n String) ENGINE = ReplacingMergeTree(ddate, (id), 8192);
create table bar (ddate Date, id Int64, n String, foo_id Int64) ENGINE = ReplacingMergeTree(ddate, (id), 8192);
insert into bar (id, n, foo_id) values (1, 'bar_n_1', 1);
create MATERIALIZED view view_foo_bar ENGINE = ReplacingMergeTree(ddate, (bar_id), 8192) as select ddate, bar_id, bar_n, foo_id, foo_n from (select ddate, id as bar_id, n as bar_n, foo_id from bar) any left join (select id as foo_id, n as foo_n from foo) using foo_id;
insert into bar (id, n, foo_id) values (1, 'bar_n_1', 1);
SELECT * FROM view_foo_bar;
DROP TABLE foo;
DROP TABLE bar;
DROP TABLE view_foo_bar;