diff --git a/tests/queries/0_stateless/01890_materialized_distributed_join.reference b/tests/queries/0_stateless/01890_materialized_distributed_join.reference new file mode 100644 index 00000000000..315ebca7e7a --- /dev/null +++ b/tests/queries/0_stateless/01890_materialized_distributed_join.reference @@ -0,0 +1,8 @@ +1 1 1 2 +1 1 1 2 +1 1 1 2 +1 1 1 2 +1 1 1 2 +1 1 1 2 +2 +4 diff --git a/tests/queries/0_stateless/01890_materialized_distributed_join.sql b/tests/queries/0_stateless/01890_materialized_distributed_join.sql new file mode 100644 index 00000000000..0020419981b --- /dev/null +++ b/tests/queries/0_stateless/01890_materialized_distributed_join.sql @@ -0,0 +1,24 @@ +drop table if exists test_distributed; +drop table if exists test_source; +drop table if exists test_shard; +drop table if exists test_local; + +create table test_shard (k UInt64, v UInt64) ENGINE Memory(); +create table test_local (k UInt64, v UInt64) ENGINE Memory(); +create table test_source (k UInt64, v UInt64) ENGINE Memory(); + +insert into test_shard values (1, 1); +insert into test_local values (1, 2); + +create materialized view test_distributed engine Distributed('test_cluster_two_shards', currentDatabase(), 'test_shard', k) as select k, v from test_source; + +select * from test_distributed td asof join test_local tl on td.k = tl.k and td.v < tl.v; +select * from test_distributed td asof join test_local tl on td.k = tl.k and td.v < tl.v order by td.v; +select * from test_distributed td asof join test_local tl on td.k = tl.k and td.v < tl.v order by tl.v; +select sum(td.v) from test_distributed td asof join test_local tl on td.k = tl.k and td.v < tl.v group by tl.k; +select sum(tl.v) from test_distributed td asof join test_local tl on td.k = tl.k and td.v < tl.v group by td.k; + +drop table test_distributed; +drop table test_source; +drop table test_shard; +drop table test_local; diff --git a/tests/queries/0_stateless/arcadia_skip_list.txt b/tests/queries/0_stateless/arcadia_skip_list.txt index a59c1a72a52..39cc75d2f5d 100644 --- a/tests/queries/0_stateless/arcadia_skip_list.txt +++ b/tests/queries/0_stateless/arcadia_skip_list.txt @@ -240,3 +240,4 @@ 01880_remote_ipv6 01882_scalar_subquery_exception 01882_check_max_parts_to_merge_at_once +01890_materialized_distributed_join