mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Correct sample_block in HashJoin for dict join with join_algorithm = auto
This commit is contained in:
parent
14800f0c52
commit
a95c4dcfff
@ -571,7 +571,7 @@ namespace
|
||||
void HashJoin::initRightBlockStructure(Block & saved_block_sample)
|
||||
{
|
||||
/// We could remove key columns for LEFT | INNER HashJoin but we should keep them for JoinSwitcher (if any).
|
||||
bool save_key_columns = !table_join->forceHashJoin() || isRightOrFull(kind);
|
||||
bool save_key_columns = !(table_join->forceHashJoin() || table_join->dictionary_reader) || isRightOrFull(kind);
|
||||
if (save_key_columns)
|
||||
{
|
||||
saved_block_sample = right_table_keys.cloneEmpty();
|
||||
|
@ -101,3 +101,9 @@ not optimized (smoke)
|
||||
-
|
||||
2 2 2 2
|
||||
3 3 3 3
|
||||
issue 23002
|
||||
0 0 0 0 0
|
||||
1 1 1 1 1
|
||||
2 2 2 2 2
|
||||
3 3 3 3 3
|
||||
4 0 0 0
|
||||
|
@ -82,6 +82,11 @@ SELECT * FROM (SELECT number AS key FROM numbers(2)) s1 SEMI RIGHT JOIN dict_fla
|
||||
SELECT '-';
|
||||
SELECT * FROM (SELECT number AS key FROM numbers(2)) s1 ANTI RIGHT JOIN dict_flat d USING(key) ORDER BY s1.key;
|
||||
|
||||
SET join_use_nulls = 0;
|
||||
SET join_algorithm = 'auto';
|
||||
SELECT 'issue 23002';
|
||||
SELECT * FROM (SELECT number AS key FROM numbers(5)) s1 LEFT JOIN dict_flat d ON s1.key = d.key ORDER BY s1.key;
|
||||
|
||||
DROP DICTIONARY dict_flat;
|
||||
DROP DICTIONARY dict_hashed;
|
||||
DROP DICTIONARY dict_complex_cache;
|
||||
|
Loading…
Reference in New Issue
Block a user