From 32c5aee1c34b68cd992b0fb81565caa7fc702e4e Mon Sep 17 00:00:00 2001 From: taiyang-li <654010905@qq.com> Date: Mon, 18 Sep 2023 16:31:36 +0800 Subject: [PATCH] fix ut --- ...5_array_join_with_max_block_size.reference | 176 ++++++++++-------- .../02865_array_join_with_max_block_size.sql | 16 +- 2 files changed, 108 insertions(+), 84 deletions(-) diff --git a/tests/queries/0_stateless/02865_array_join_with_max_block_size.reference b/tests/queries/0_stateless/02865_array_join_with_max_block_size.reference index 9ea48287e78..29f4a91cc22 100644 --- a/tests/queries/0_stateless/02865_array_join_with_max_block_size.reference +++ b/tests/queries/0_stateless/02865_array_join_with_max_block_size.reference @@ -1,81 +1,103 @@ -- { echoOn } set max_block_size = 10, enable_unaligned_array_join = true; -SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(1000000))) ARRAY JOIN x as n group by n; -0 100000 -1 100000 -2 100000 -3 100000 -4 100000 -5 100000 -6 100000 -7 100000 -8 100000 -9 100000 -SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(10000)) LEFT ARRAY JOIN x as n group by n % 10; -0 5004001 -1 5003000 -2 5002000 -3 5001000 -4 5000000 -5 4999000 -6 4998000 -7 4997000 -8 4996000 -9 4995000 -SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(10000)) ARRAY JOIN x as m, y as n group by (m+n) % 10; -0 10006000 -1 1000 -2 10004000 -3 1000 -4 10002000 -5 1000 -6 10000000 -7 1000 -8 9998000 -9 1000 +SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(100000))) ARRAY JOIN x as n group by n; +0 10000 +1 10000 +2 10000 +3 10000 +4 10000 +5 10000 +6 10000 +7 10000 +8 10000 +9 10000 +SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(1000)) LEFT ARRAY JOIN x as n group by n % 10; +0 50401 +1 50300 +2 50200 +3 50100 +4 50000 +5 49900 +6 49800 +7 49700 +8 49600 +9 49500 +SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(100)) ARRAY JOIN x as m, y as n group by (m+n) % 10; +0 1060 +1 10 +2 1040 +3 10 +4 1020 +5 10 +6 1000 +7 10 +8 980 +9 10 set max_block_size = 1000, enable_unaligned_array_join = true; -SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(1000000))) ARRAY JOIN x as n group by n; -0 100000 -1 100000 -2 100000 -3 100000 -4 100000 -5 100000 -6 100000 -7 100000 -8 100000 -9 100000 -SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(10000)) LEFT ARRAY JOIN x as n group by n % 10; -0 5004001 -1 5003000 -2 5002000 -3 5001000 -4 5000000 -5 4999000 -6 4998000 -7 4997000 -8 4996000 -9 4995000 +SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(100000))) ARRAY JOIN x as n group by n; +0 10000 +1 10000 +2 10000 +3 10000 +4 10000 +5 10000 +6 10000 +7 10000 +8 10000 +9 10000 +SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(1000)) LEFT ARRAY JOIN x as n group by n % 10; +0 50401 +1 50300 +2 50200 +3 50100 +4 50000 +5 49900 +6 49800 +7 49700 +8 49600 +9 49500 +SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(100)) ARRAY JOIN x as m, y as n group by (m+n) % 10; +0 1060 +1 10 +2 1040 +3 10 +4 1020 +5 10 +6 1000 +7 10 +8 980 +9 10 set max_block_size = 100000, enable_unaligned_array_join = true; -SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(1000000))) ARRAY JOIN x as n group by n; -0 100000 -1 100000 -2 100000 -3 100000 -4 100000 -5 100000 -6 100000 -7 100000 -8 100000 -9 100000 -SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(10000)) LEFT ARRAY JOIN x as n group by n % 10; -0 5004001 -1 5003000 -2 5002000 -3 5001000 -4 5000000 -5 4999000 -6 4998000 -7 4997000 -8 4996000 -9 4995000 +SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(100000))) ARRAY JOIN x as n group by n; +0 10000 +1 10000 +2 10000 +3 10000 +4 10000 +5 10000 +6 10000 +7 10000 +8 10000 +9 10000 +SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(1000)) LEFT ARRAY JOIN x as n group by n % 10; +0 50401 +1 50300 +2 50200 +3 50100 +4 50000 +5 49900 +6 49800 +7 49700 +8 49600 +9 49500 +SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(100)) ARRAY JOIN x as m, y as n group by (m+n) % 10; +0 1060 +1 10 +2 1040 +3 10 +4 1020 +5 10 +6 1000 +7 10 +8 980 +9 10 diff --git a/tests/queries/0_stateless/02865_array_join_with_max_block_size.sql b/tests/queries/0_stateless/02865_array_join_with_max_block_size.sql index fe393d6ccd6..bc82978262a 100644 --- a/tests/queries/0_stateless/02865_array_join_with_max_block_size.sql +++ b/tests/queries/0_stateless/02865_array_join_with_max_block_size.sql @@ -1,14 +1,16 @@ -- { echoOn } set max_block_size = 10, enable_unaligned_array_join = true; -SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(1000000))) ARRAY JOIN x as n group by n; -SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(10000)) LEFT ARRAY JOIN x as n group by n % 10; -SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(10000)) ARRAY JOIN x as m, y as n group by (m+n) % 10; +SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(100000))) ARRAY JOIN x as n group by n; +SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(1000)) LEFT ARRAY JOIN x as n group by n % 10; +SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(100)) ARRAY JOIN x as m, y as n group by (m+n) % 10; set max_block_size = 1000, enable_unaligned_array_join = true; -SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(1000000))) ARRAY JOIN x as n group by n; -SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(10000)) LEFT ARRAY JOIN x as n group by n % 10; +SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(100000))) ARRAY JOIN x as n group by n; +SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(1000)) LEFT ARRAY JOIN x as n group by n % 10; +SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(100)) ARRAY JOIN x as m, y as n group by (m+n) % 10; set max_block_size = 100000, enable_unaligned_array_join = true; -SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(1000000))) ARRAY JOIN x as n group by n; -SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(10000)) LEFT ARRAY JOIN x as n group by n % 10; +SELECT n, count(1) from (SELECT groupArray(number % 10) AS x FROM (SELECT * FROM numbers(100000))) ARRAY JOIN x as n group by n; +SELECT n % 10, count(1) from (SELECT range(0, number) as x FROM numbers(1000)) LEFT ARRAY JOIN x as n group by n % 10; +SELECT (m+n) % 10, count(1) from (SELECT range(0, number+1) as x, range(0, number+2) as y FROM numbers(100)) ARRAY JOIN x as m, y as n group by (m+n) % 10; -- { echoOff }