You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ngrambf_v1 index produces false negatives for LIKE patterns with backslash-escaped non-special characters #51154
bugConfirmed user-visible misbehaviour in official releasecomp-skip-indexSkipping indexes (minmax, set, bloom) and their evaluation.externalAuthor is not a member of the ClickHouse organization
CREATETABLEtest (
`data` String,
INDEX test_idx data TYPE ngrambf_v1(2, 1024, 3, 0) GRANULARITY 1
) ENGINE = MergeTree ORDER BY (data);
INSERT INTO test VALUES ('aaa\\bbb');
-- Returns 1 row (correct)SELECT*FROM test WHERE data LIKE'%a\\b%' SETTINGS ignore_data_skipping_indices='test_idx';
-- Returns 0 rows (false negative)SELECT*FROM test WHERE data LIKE'%a\\b%';
Both should return the same result. Switching backslash to some other random character (like forward slash) works as expected
changed the title [-]The ngrambf_v1 index, dependent on the window size, can yield inconsistent results for LIKE queries on strings that contain backslashes.[/-][+]`ngrambf_v1` index produces false negatives for `LIKE` patterns with backslash-escaped non-special characters[/+]on Mar 30, 2026
bugConfirmed user-visible misbehaviour in official releasecomp-skip-indexSkipping indexes (minmax, set, bloom) and their evaluation.externalAuthor is not a member of the ClickHouse organization
Activity
[-]The ngrambf_v1 index, dependent on the window size, can yield inconsistent results for LIKE queries on strings that contain backslashes.[/-][+]`ngrambf_v1` index produces false negatives for `LIKE` patterns with backslash-escaped non-special characters[/+]rienath commentedon Mar 30, 2026
fyi @scanhex12
rienath commentedon Mar 30, 2026
Sorry, @scanhex12, made a mistake. You implemented sparse-grams, not general n-grams