Repository navigation
Add test: Keep-on-match inline-filter branch if(token IN/NOT IN (...), token, '') in tryExtractInlineFilter is untested - #111509
clickgapai wants to merge 1 commit into
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [82a6564] Summary: ✅ AI ReviewSummaryThis PR adds a stateless SQL test for the keep-on-match Tests
Final VerdictStatus: |
| INSERT INTO tab_keep_in VALUES (1, 'the quick brown fox'), (2, 'a fox is here'), (3, 'is the end'); | ||
|
|
||
| SELECT 'if(token IN (...), token, ...): only the listed tokens survive'; | ||
| SELECT arrayStringConcat(arraySort(groupArray(token)), ' ') FROM mergeTreeTextIndex(currentDatabase(), tab_keep_in, idx); |
There was a problem hiding this comment.
This only checks the final token set and hasToken answers, but those stay the same even if tryExtractInlineFilter stops recognizing the keep-on-match shape entirely. In that case MergeTreeIndexAggregatorText::update just falls back to processTokensArrayBatch, which preserves the same user-visible result for these rows.
So the new SQL test does not actually guard the PR's stated coverage gap at MergeTreeIndexTextPostprocessor.cpp:108-109; it still goes green when that branch returns nullopt. Can we make the extraction observable here, or add a focused lower-level test around MergeTreeIndexTextPostprocessor / getInlineFilter so the keep-on-match path fails when it stops being recognized?
|
@zlareb1 There are grammar errors in the PR message. If they are part of some template, kindly fix, thanks.
|
|
Continued in #111649 |
Increase coverage for text index postprocessor fast path for ClickHouse#111509
Increase coverage for text index postprocessor fast path for ClickHouse#111509

Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path, found during automated review of PR #109049.
The PR adds a fast path to the text-index aggregator for filter-only postprocessors of the shape
if/multiIf(token IN/NOT IN (<string literals>), '', token).tryExtractInlineFilterinMergeTreeIndexTextPostprocessor.cppparses the postprocessor AST into aMergeTreeIndexTextInlineFilter…1. Keep-on-match inline-filter branch
if(token IN/NOT IN (...), token, '')intryExtractInlineFilteris untestedsrc/Storages/MergeTree/MergeTreeIndexTextPostprocessor.cpp:109Risk:
tryExtractInlineFilteratMergeTreeIndexTextPostprocessor.cpp:108-109 takes thedrop_on_condition = falsebranch only when the token identifier is the then-branch and '' is the else-branch.filter.drop_on_matchis then computed asis_not_in ? !drop_on_condition : drop_on_conditionand drivesshouldDropinaddToken, which decides per distinct token whether it enters the index. RISK: if this branch or thedrop_on_matchinversion is broken, the keep-on-match filter silently …What's unique vs PR tests: The PR's own test (02346_text_index_postprocessor_in_filter.sql) only covers the drop-on-match spelling if(cond, '', token) — token on the else-branch. This test covers the mirror keep-on-match spelling if(cond, token, '') — token on the then-branch — which is the only trigger of the line 108-109 branch, plus its NOT IN inversion.
Tags:
-- Tags: no-fasttest—no-fasttest: text indexes are not built in the FastTest minimal buildTry it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes