mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Fix bug in short circuit optimization with cache dictionaries
This commit is contained in:
parent
f4c5d172ac
commit
5f5a6d5f10
@ -511,7 +511,10 @@ MutableColumns CacheDictionary<dictionary_key_type>::aggregateColumns(
|
||||
if (default_mask)
|
||||
{
|
||||
if (key_state_from_storage.isDefault())
|
||||
{
|
||||
(*default_mask)[key_index] = 1;
|
||||
aggregated_column->insertDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
(*default_mask)[key_index] = 0;
|
||||
|
@ -0,0 +1,31 @@
|
||||
DROP TABLE IF EXISTS complex_key_simple_attributes_source_short_circuit_table;
|
||||
DROP DICTIONARY IF EXISTS cache_dictionary_complex_key_simple_attributes_short_circuit;
|
||||
|
||||
CREATE TABLE complex_key_simple_attributes_source_short_circuit_table
|
||||
(
|
||||
id UInt64,
|
||||
id_key String,
|
||||
value_first String,
|
||||
value_second String
|
||||
)
|
||||
ENGINE = TinyLog;
|
||||
|
||||
INSERT INTO complex_key_simple_attributes_source_short_circuit_table VALUES(0, 'id_key_0', 'value_0', 'value_second_0');
|
||||
|
||||
CREATE DICTIONARY cache_dictionary_complex_key_simple_attributes_short_circuit
|
||||
(
|
||||
`id` UInt64,
|
||||
`id_key` String,
|
||||
`value_first` String DEFAULT 'value_first_default',
|
||||
`value_second` String DEFAULT 'value_second_default'
|
||||
)
|
||||
PRIMARY KEY id, id_key
|
||||
SOURCE(CLICKHOUSE(TABLE 'complex_key_simple_attributes_source_short_circuit_table'))
|
||||
LIFETIME(MIN 1 MAX 1000)
|
||||
LAYOUT(COMPLEX_KEY_CACHE(SIZE_IN_CELLS 10));
|
||||
|
||||
SELECT dictGetOrDefault('cache_dictionary_complex_key_simple_attributes_short_circuit', 'value_first', (number, concat(toString(number))), toString(materialize('default'))) AS value_first FROM system.numbers LIMIT 20 FORMAT Null;
|
||||
SELECT dictGetOrDefault('cache_dictionary_complex_key_simple_attributes_short_circuit', 'value_first', (number, concat(toString(number))), toString(materialize('default'))) AS value_first FROM system.numbers LIMIT 20 FORMAT Null;
|
||||
|
||||
DROP TABLE IF EXISTS complex_key_simple_attributes_source_short_circuit_table;
|
||||
DROP DICTIONARY IF EXISTS cache_dictionary_complex_key_simple_attributes_short_circuit;
|
Loading…
Reference in New Issue
Block a user