mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Add test 02962_max_joined_block_rows
This commit is contained in:
parent
0f2588334f
commit
8dad3f1b22
@ -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
|
38
tests/queries/0_stateless/02962_max_joined_block_rows.sql
Normal file
38
tests/queries/0_stateless/02962_max_joined_block_rows.sql
Normal 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;
|
Loading…
Reference in New Issue
Block a user