mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #45617 from ClickHouse/fix-bfngram-index
Correctly check types when using N-gram bloom filter index
This commit is contained in:
commit
6fe9e9a67f
@ -468,6 +468,10 @@ bool MergeTreeConditionFullText::traverseTreeEquals(
|
||||
{
|
||||
key_column_num = map_keys_key_column_num;
|
||||
key_exists = true;
|
||||
|
||||
auto const_data_type = WhichDataType(const_type);
|
||||
if (!const_data_type.isStringOrFixedString() && !const_data_type.isArray())
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
14
tests/queries/0_stateless/02538_ngram_bf_index_with_null.sql
Normal file
14
tests/queries/0_stateless/02538_ngram_bf_index_with_null.sql
Normal file
@ -0,0 +1,14 @@
|
||||
DROP TABLE IF EXISTS 02538_bf_ngrambf_map_values_test;
|
||||
|
||||
CREATE TABLE 02538_bf_ngrambf_map_values_test (`row_id` Int128, `map` Map(String, String), `map_fixed` Map(FixedString(2), String),
|
||||
INDEX map_values_ngrambf mapKeys(map) TYPE ngrambf_v1(4, 256, 2, 0) GRANULARITY 1,
|
||||
INDEX map_fixed_values_ngrambf mapKeys(map_fixed) TYPE ngrambf_v1(4, 256, 2, 0) GRANULARITY 1)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY row_id
|
||||
SETTINGS index_granularity = 1;
|
||||
|
||||
INSERT INTO 02538_bf_ngrambf_map_values_test VALUES (1, {'a': 'a'}, {'b': 'b'});
|
||||
|
||||
SELECT * FROM 02538_bf_ngrambf_map_values_test PREWHERE (map['']) = 'V2V\0V2V2V2V2V2V2' WHERE (map[NULL]) = 'V2V\0V2V2V2V2V2V2V2V\0V2V2V2V2V2V2V2V\0V2V2V2V2V2V2V2V\0V2V2V2V2V2V2' SETTINGS force_data_skipping_indices = 'map_values_ngrambf';
|
||||
|
||||
DROP TABLE 02538_bf_ngrambf_map_values_test;
|
Loading…
Reference in New Issue
Block a user