Add test 02962_max_joined_block_rows

This commit is contained in:
vdimir 2024-01-08 10:58:26 +00:00
parent 0f2588334f
commit 8dad3f1b22
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,32 @@
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
--
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
--
1 0
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9

View File

@ -0,0 +1,38 @@
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE table t1 (a UInt64, b UInt64) ENGINE = Memory;
INSERT INTO t1 SELECT number % 2, number FROM numbers(10);
CREATE table t2 (a UInt64) ENGINE = Memory;
INSERT INTO t2 SELECT number % 2 FROM numbers(10);
-- block size is always multiple of 5 because we have 5 rows for each key in right table
-- we do not split rows corresponding to the same key
SELECT max(bs) <= 5, b FROM (
SELECT blockSize() as bs, * FROM t1 JOIN t2 ON t1.a = t2.a
) GROUP BY b
ORDER BY b
SETTINGS max_joined_block_size_rows = 5;
SELECT '--';
SELECT max(bs) <= 10, b FROM (
SELECT blockSize() as bs, * FROM t1 JOIN t2 ON t1.a = t2.a
) GROUP BY b
ORDER BY b
SETTINGS max_joined_block_size_rows = 10;
SELECT '--';
-- parallel_hash doen't support max_joined_block_size_rows
SET join_algorithm = 'parallel_hash';
SELECT max(bs) > 10, b FROM (
SELECT blockSize() as bs, * FROM t1 JOIN t2 ON t1.a = t2.a
) GROUP BY b
ORDER BY b
SETTINGS max_joined_block_size_rows = 10;