Repository navigation
Backport #99286 to 26.2: Support text index built on mapValues with IN operator - #99361
Conversation
03da9e1 to
0dbd55c
Compare
|
Workflow [BackportPR], commit [0dbd55c] Summary: ✅ |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| /// The condition with such a predicate will be always true on granule. | ||
| /// See MergeTreeIndexGranuleText::hasAllQueryTokensOrEmpty. | ||
| if (ref.empty()) | ||
| return false; |
There was a problem hiding this comment.
Partial text_search_queries left in out on early return
Low Severity
When the empty string check at ref.empty() triggers return false mid-loop, out.text_search_queries may already contain entries from previous iterations. The caller (traverseAtomNode) doesn't use out on failure, but the RPNBuilder stores the element with FUNCTION_UNKNOWN and the orphaned queries. The constructor then iterates all elements' text_search_queries unconditionally, adding these orphan tokens to all_search_tokens_set and all_search_queries, causing unnecessary token loading from the text index. Clearing out.text_search_queries before returning false would avoid this.


Original pull-request #99286
Cherry-pick pull-request #99360
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Note
Medium Risk
Changes text-index predicate analysis for
IN(including tuple-IN) and adds a new guard for empty-string set elements, which can affect index selection and query correctness/performance on MergeTree reads.Overview
Extends text index condition building so
INpredicates onmap['key'](i.e.,arrayElement(map, 'key')) can use a text index built onmapValues(map), including when the indexed expression appears inside tuple-IN.Prevents using the text index for
INsets that contain an empty string (sincemap['missing']yields''), avoiding incorrect granule skipping. Adds stateless tests coveringmapValues+IN, combinedmapKeys/mapValuespruning, and empty-string behavior.Written by Cursor Bugbot for commit 0dbd55c. This will update automatically on new commits. Configure here.
Version info
26.2.5.23