mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Test cleanup
This commit is contained in:
parent
b2dbbea179
commit
33fb3b7099
@ -2,7 +2,7 @@
|
||||
|
||||
set parallel_replicas_prefer_local_join = 0;
|
||||
-- A query with only INNER/LEFT joins is fully send to replicas. JOIN is executed in GLOBAL mode.
|
||||
select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -18,7 +18,7 @@ select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x
|
||||
13 13 0 0 0 0
|
||||
14 14 14 14 0 0
|
||||
15 15 0 0 0 0
|
||||
explain description=0 select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
explain description=0 select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z;
|
||||
Union
|
||||
Expression
|
||||
Join
|
||||
@ -40,8 +40,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -63,8 +62,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Union
|
||||
@ -90,8 +88,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select sum(x), sum(y), sum(r.y), sum(z), sum(rr.z), sum(a), key from sub3 ll any left join sub4 rr on ll.z = rr.z group by x % 2 as key)
|
||||
select * from sub5 order by key
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by key;
|
||||
54 54 50 50 12 12 0
|
||||
64 64 0 0 0 0 1
|
||||
explain description=0
|
||||
@ -100,8 +97,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select sum(x), sum(y), sum(r.y), sum(z), sum(rr.z), sum(a), key from sub3 ll any left join sub4 rr on ll.z = rr.z group by x % 2 as key)
|
||||
select * from sub5 order by key
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by key;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -129,8 +125,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y order by l.x),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -152,8 +147,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y order by l.x),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -181,8 +175,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -204,8 +197,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -237,8 +229,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub2 r any right join sub1 l on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, l.y, y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5;
|
||||
0 0 0 0 0 0
|
||||
6 6 6 6 0 0
|
||||
8 8 8 8 0 0
|
||||
@ -260,8 +251,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub2 r any right join sub1 l on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, l.y, y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5;
|
||||
Union
|
||||
Expression
|
||||
Join
|
||||
@ -283,7 +273,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select z, a, x, y, r.y, ll.z from sub4 rr any right join sub3 ll on ll.z = rr.z)
|
||||
select * from sub5 order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
0 0 1 1 0 0
|
||||
0 0 3 3 0 0
|
||||
@ -305,7 +295,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select z, a, x, y, r.y, ll.z from sub4 rr any right join sub3 ll on ll.z = rr.z)
|
||||
select * from sub5 order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Union
|
||||
@ -332,8 +322,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -355,8 +344,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Union
|
||||
@ -389,7 +377,7 @@ sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1, parallel_replicas_allow_in_with_subquery=0;
|
||||
SETTINGS enable_parallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -412,7 +400,7 @@ sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1, parallel_replicas_allow_in_with_subquery=0;-- { echoOn }
|
||||
SETTINGS enable_parallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0;-- { echoOn }
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -442,7 +430,7 @@ Expression
|
||||
ReadFromRemoteParallelReplicas
|
||||
set parallel_replicas_prefer_local_join = 1;
|
||||
-- A query with only INNER/LEFT joins is fully send to replicas. JOIN is executed in GLOBAL mode.
|
||||
select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -458,7 +446,7 @@ select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x
|
||||
13 13 0 0 0 0
|
||||
14 14 14 14 0 0
|
||||
15 15 0 0 0 0
|
||||
explain description=0 select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
explain description=0 select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z;
|
||||
Union
|
||||
Expression
|
||||
Join
|
||||
@ -482,8 +470,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -505,8 +492,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Union
|
||||
@ -534,8 +520,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select sum(x), sum(y), sum(r.y), sum(z), sum(rr.z), sum(a), key from sub3 ll any left join sub4 rr on ll.z = rr.z group by x % 2 as key)
|
||||
select * from sub5 order by key
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by key;
|
||||
54 54 50 50 12 12 0
|
||||
64 64 0 0 0 0 1
|
||||
explain description=0
|
||||
@ -544,8 +529,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select sum(x), sum(y), sum(r.y), sum(z), sum(rr.z), sum(a), key from sub3 ll any left join sub4 rr on ll.z = rr.z group by x % 2 as key)
|
||||
select * from sub5 order by key
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by key;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -575,8 +559,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y order by l.x),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -598,8 +581,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y order by l.x),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -628,8 +610,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -651,8 +632,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
@ -684,8 +664,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub2 r any right join sub1 l on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, l.y, y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5;
|
||||
0 0 0 0 0 0
|
||||
6 6 6 6 0 0
|
||||
8 8 8 8 0 0
|
||||
@ -707,8 +686,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub2 r any right join sub1 l on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, l.y, y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5;
|
||||
Union
|
||||
Expression
|
||||
Join
|
||||
@ -732,7 +710,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select z, a, x, y, r.y, ll.z from sub4 rr any right join sub3 ll on ll.z = rr.z)
|
||||
select * from sub5 order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
0 0 1 1 0 0
|
||||
0 0 3 3 0 0
|
||||
@ -754,7 +732,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select z, a, x, y, r.y, ll.z from sub4 rr any right join sub3 ll on ll.z = rr.z)
|
||||
select * from sub5 order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Union
|
||||
@ -782,8 +760,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -805,8 +782,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
Expression
|
||||
Sorting
|
||||
Union
|
||||
@ -841,7 +817,7 @@ sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1, parallel_replicas_allow_in_with_subquery=0;
|
||||
SETTINGS enable_parallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0;
|
||||
0 0 0 0 0 0
|
||||
1 1 0 0 0 0
|
||||
3 3 0 0 0 0
|
||||
@ -864,7 +840,7 @@ sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1, parallel_replicas_allow_in_with_subquery=0;
|
||||
SETTINGS enable_parallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0;
|
||||
Expression
|
||||
Sorting
|
||||
Expression
|
||||
|
@ -1,16 +1,17 @@
|
||||
drop table if exists tab1;
|
||||
drop table if exists tab2;
|
||||
drop table if exists tab3;
|
||||
drop table if exists tab1 sync;
|
||||
drop table if exists tab2 sync;
|
||||
drop table if exists tab3 sync;
|
||||
|
||||
create table tab1 (x UInt32, y UInt32, shard UInt32) engine = MergeTree order by shard;
|
||||
create table tab2 (y UInt32, z UInt32) engine = MergeTree order by tuple();
|
||||
create table tab3 (z UInt32, a UInt32) engine = MergeTree order by tuple();
|
||||
create table tab1 (x UInt32, y UInt32, shard UInt32) engine = ReplicatedMergeTree('/clickhouse/tables/{database}/test_02967/tab1', 'r1') order by shard;
|
||||
create table tab2 (y UInt32, z UInt32) engine = ReplicatedMergeTree('/clickhouse/tables/{database}/test_02967/tab2', 'r1') order by tuple();
|
||||
create table tab3 (z UInt32, a UInt32) engine = ReplicatedMergeTree('/clickhouse/tables/{database}/test_02967/tab3', 'r1') order by tuple();
|
||||
|
||||
insert into tab1 select number, number, number from numbers(16);
|
||||
insert into tab2 select number * 2, number * 2 from numbers(8);
|
||||
insert into tab3 select number * 4, number * 4 from numbers(4);
|
||||
|
||||
set parallel_replicas_local_plan=1;
|
||||
set enable_analyzer = 1;
|
||||
set enable_parallel_replicas = 2, max_parallel_replicas = 2, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', parallel_replicas_local_plan = 1;
|
||||
|
||||
{% for use_global_in in [0, 1] -%}
|
||||
|
||||
@ -19,8 +20,9 @@ set parallel_replicas_local_plan=1;
|
||||
set parallel_replicas_prefer_local_join = {{use_global_in}};
|
||||
|
||||
-- A query with only INNER/LEFT joins is fully send to replicas. JOIN is executed in GLOBAL mode.
|
||||
select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
explain description=0 select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z order by x;
|
||||
explain description=0 select x, y, r.y, z, rr.z, a from (select l.x, l.y, r.y, r.z as z from (select x, y from tab1 where x != 2) l any left join (select y, z from tab2 where y != 4) r on l.y = r.y) ll any left join (select z, a from tab3 where z != 8) rr on ll.z = rr.z;
|
||||
|
||||
--
|
||||
-- The same query with cte;
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -28,8 +30,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -37,8 +38,8 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
--
|
||||
-- GROUP BY should work up to WithMergableStage
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -46,8 +47,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select sum(x), sum(y), sum(r.y), sum(z), sum(rr.z), sum(a), key from sub3 ll any left join sub4 rr on ll.z = rr.z group by x % 2 as key)
|
||||
select * from sub5 order by key
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by key;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -55,8 +55,8 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select sum(x), sum(y), sum(r.y), sum(z), sum(rr.z), sum(a), key from sub3 ll any left join sub4 rr on ll.z = rr.z group by x % 2 as key)
|
||||
select * from sub5 order by key
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by key;
|
||||
|
||||
--
|
||||
-- ORDER BY in sub3 : sub1 is fully pushed, sub3 -> WithMergableStage
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -64,8 +64,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y order by l.x),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -73,8 +72,8 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y order by l.x),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
--
|
||||
-- ORDER BY in sub1 : sub1 -> WithMergableStage
|
||||
with sub1 as (select x, y from tab1 where x != 2 order by y),
|
||||
@ -82,8 +81,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x != 2 order by y),
|
||||
@ -91,8 +89,8 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
--
|
||||
-- RIGHT JOIN in sub3: sub3 -> WithMergableStage
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -100,8 +98,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub2 r any right join sub1 l on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, l.y, y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -109,8 +106,8 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub2 r any right join sub1 l on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, l.y, y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5;
|
||||
|
||||
--
|
||||
-- RIGHT JOIN in sub5: sub5 -> WithMergableStage
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -118,7 +115,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select z, a, x, y, r.y, ll.z from sub4 rr any right join sub3 ll on ll.z = rr.z)
|
||||
select * from sub5 order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x != 2),
|
||||
@ -126,7 +123,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select z, a, x, y, r.y, ll.z from sub4 rr any right join sub3 ll on ll.z = rr.z)
|
||||
select * from sub5 order by x SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
--
|
||||
-- Subqueries for IN allowed
|
||||
@ -135,8 +132,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x in (select number from numbers(16) where number != 2)),
|
||||
@ -144,8 +140,7 @@ sub2 as (select y, z from tab2 where y != 4),
|
||||
sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y = r.y),
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 2, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1;
|
||||
select * from sub5 order by x;
|
||||
|
||||
--
|
||||
-- Subqueries for IN are not allowed
|
||||
@ -155,7 +150,7 @@ sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1, parallel_replicas_allow_in_with_subquery=0;
|
||||
SETTINGS enable_parallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0;
|
||||
|
||||
explain description=0
|
||||
with sub1 as (select x, y from tab1 where x in (select number from numbers(16) where number != 2)),
|
||||
@ -164,6 +159,6 @@ sub3 as (select l.x, l.y, r.y, r.z as z from sub1 l any left join sub2 r on l.y
|
||||
sub4 as (select z, a from tab3 where z != 8),
|
||||
sub5 as (select x, y, r.y, z, rr.z, a from sub3 ll any left join sub4 rr on ll.z = rr.z)
|
||||
select * from sub5 order by x
|
||||
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 2, parallel_replicas_for_non_replicated_merge_tree = 1, prefer_localhost_replica = 1, cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost', enable_analyzer=1, parallel_replicas_allow_in_with_subquery=0;
|
||||
SETTINGS enable_parallel_replicas = 1, parallel_replicas_allow_in_with_subquery = 0;
|
||||
|
||||
{%- endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user