add tests

This commit is contained in:
abel-wang 2021-11-10 16:38:01 +08:00
parent 4ad729c7d4
commit 3b82c36049
2 changed files with 0 additions and 43 deletions

View File

@ -1,62 +1,27 @@
-- { echo }
CREATE DATABASE IF NOT EXISTS test_02115;
USE test_02115;
DROP TABLE IF EXISTS t1_local;
DROP TABLE IF EXISTS t2_local;
DROP TABLE IF EXISTS t1_all;
DROP TABLE IF EXISTS t2_all;
create table t1_local(a Int32) engine=MergeTree() order by a;
create table t2_local as t1_local;
create table t1_all as t1_local engine Distributed(test_cluster_two_shards_localhost, test_02115, t1_local, rand());
create table t2_all as t2_local engine Distributed(test_cluster_two_shards_localhost, test_02115, t2_local, rand());
insert into t1_local values(1), (2), (3);
insert into t2_local values(1), (2), (3);
set distributed_product_mode = 'local';
explain syntax select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
SELECT a
FROM t1_all AS t1
WHERE a IN ((
SELECT t2.a
FROM test_02115.t2_local AS t2
) AS _subquery5)
select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
1
2
3
1
2
3
explain syntax select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
SELECT a
FROM t1_all AS t1
ALL INNER JOIN test_02115.t2_local AS t2 ON a = t2.a
select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
1
2
3
1
2
3
set distributed_product_mode = 'global';
explain syntax select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
SELECT a
FROM t1_all AS t1
WHERE a GLOBAL IN ((
SELECT t2.a
FROM t2_all AS t2
) AS _subquery7)
select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
1
2
3
1
2
3
explain syntax select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
SELECT a
FROM t1_all AS t1
GLOBAL ALL INNER JOIN t2_all AS t2 ON a = t2.a
select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
1
1
2
@ -69,8 +34,3 @@ select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
2
3
3
DROP TABLE t1_local;
DROP TABLE t2_local;
DROP TABLE t1_all;
DROP TABLE t2_all;
DROP DATABASE test_02115;

View File

@ -16,14 +16,11 @@ insert into t1_local values(1), (2), (3);
insert into t2_local values(1), (2), (3);
set distributed_product_mode = 'local';
explain syntax select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
explain syntax select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
set distributed_product_mode = 'global';
explain syntax select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
select * from t1_all t1 where t1.a in (select t2.a from t2_all t2);
explain syntax select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;
select t1.* from t1_all t1 join t2_all t2 on t1.a = t2.a;