ESQL: Add the param_any_value query setting #166823
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 447 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.365
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #166823"
general
weight: 0.35
kosabogi
Stack: [#166823] - #166824 - #166825 - #166826 - #166827
The whole stack
This is part 1 of 5 of the ES|QL "Any" controls (Phase 1, see #136735). Each PR is based on the previous one and has its own tests, so it can be reviewed separately.
An "Any" value lets a client send one query for every filter state: a query parameter holding a reserved value (
"__ANY__"by default, set by theparam_any_valuequery setting) stands for "no filter on this", so the conditions that use it match everything.1. #166823 (this PR): the
param_any_valuesetting. No query changes.2. #166824: the parameter holding the value is recognized, and rejected with a clear error wherever it is used.
3. #166825: an unnamed
STATS ... BY ??gkey holding the value is dropped.4. #166826: the supported conditions that compare with the parameter are replaced with
truewhere they are the filter of aWHERE.5. #166827: "Any" errors no longer hide other errors. It also adds the changelog of the whole stack.
Everything is snapshot-only for now (GA in a later PR, once Kibana has tested it), so release builds are not affected.
Known edge cases (not handled yet)
"__ANY__"can collide with a real value (WHERE category == ?cwith a stored"__ANY__"can't be searched). To be decided before un-snapshotting: keep it, or default tonulland let Kibana send it in the request.SETvalues (limitation): a parameter used as the value of aSETis never taken for "Any".SET unmapped_fields = ?xwith?xholding the reserved value is a plain string, and fails the usual validation of that setting instead of the "Any" error. This keeps the result independent of the order of theSETs, and letsSET param_any_value = ?vwork. No current setting can take "Any" as a value; revisit this if one does.SETin subqueries and views: the grammar has noSETinside a subquery, and views can't take parameters, so they are parsed without a reserved value. If any of them is added, decide then whichparam_any_valueapplies and to what (tests:testSetInASubqueryIsRejected,testViewDefinitionCannotHaveParameters,testViewDoesNotRecognizeTheReservedValue).FROM test, (FROM remote:missingIndex | WHERE emp_no > ?x)with?xholding the value should fail likeFROM test | WHERE emp_no > ?x, but the branch is pruned before verification, so it returns the local rows.This PR
This first step only adds the setting, and changes no query.
param_any_valuequery setting (string, default"__ANY__", snapshot-only, no cluster default yet), resolved from the request orSET param_any_value = "...", inQuerySettings.ParsingContext, because the parser decides while it reads the query whether a parameter is "Any" (the following PRs), and the rest of the settings are only resolved after parsing.SETstatements of the query update it as they come, in a per-parse field of the builder (not in the sharedQueryParams). On release builds it isnull, so the default is never live there.param_any_value(snapshot-only): the single switch of the whole stack. The parser and the tests of the feature check it withisEnabled(), so it is the one place to review when the feature is un-snapshotted.SET, wrong type, empty value,SET param_any_value = ?v(accepted, as a plain value), release-build rejection,ConfigurationSerializationTests.