Repository navigation
Support text index built on mapValues with IN operator - #99286
Conversation
|
Workflow [PR], commit [7848b4f] Summary: ❌
AI Review1) SummaryThis PR enables text-index analysis for 2) Missing context (if any)
3) Findings (by severity)Blockers
Majors
4) Tests & Evidence
5) ClickHouse Compliance Checklist (Yes/No + short note)
6) Performance & Safety Notes
7) User-Lens ReviewThe feature is intuitive ( 8) Final Verdict
|
| { | ||
| if (header.has(function.getArgumentAt(i).getColumnName())) | ||
| auto argument = function.getArgumentAt(i); | ||
| if (header.has(argument.getColumnName()) || hasIndexForMapElementValue(argument)) |
There was a problem hiding this comment.
This new hasIndexForMapElementValue path extends set-based optimization to map-element predicates for both in and notIn, but there is no coverage for NOT IN on map elements. Please add stateless tests for map['k'] NOT IN (...) (and tuple NOT IN with a map element) to lock down granule-skipping behavior for the newly-enabled branch.
There was a problem hiding this comment.
The support for NOT IN doesn't really work (the index never skips granules) and it will be removed soon. So, test is not needed.
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 100.00% (35/35) |
a9e0c3a
Backport #99286 to 26.2: Support text index built on `mapValues` with `IN` operator
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support text index built on
mapValues(map)withINoperator.Note
Medium Risk
Touches text-index condition building for
IN(including tuple-IN) and changes when the index is considered applicable, which can affect query result correctness and granule skipping. Additional guardrails and new stateless tests reduce risk but this remains query-planner sensitive logic.Overview
Enables using text indexes built on
mapValues(map)to optimizeIN/tuple-INpredicates on map element access (e.g.map['k'] IN (...)), by recognizingarrayElement(map, 'key')as indexable via a newhasIndexForMapElementValue()check.Adds a correctness safeguard to disable text-index usage for
INsets containing empty strings (to avoid always-true-on-granule behavior), and introduces new stateless tests covering map-valuesIN, combined mapKeys/mapValues skipping, and empty-string edge cases.Written by Cursor Bugbot for commit 7848b4f. This will update automatically on new commits. Configure here.
Version info
26.3.1.63326.2.5.23