Repository navigation
refactor: migrate query context reference parameters - #20555
FrankChen021 wants to merge 3 commits into
Conversation
FrankChen021
left a comment
There was a problem hiding this comment.
🟡 Changes recommended
The current head still removes the public TimeseriesQuery.SKIP_EMPTY_BUCKETS constant while retaining the same context key through QueryContextParameters.SKIP_EMPTY_BUCKETS. Downstream extensions or callers compiled against that established field will fail to compile after upgrading; retain a deprecated compatibility alias before merging.
Reviewed 131 of 131 changed files; findings in 1 file. This updated-head review began with the incremental diff from 0ebfbf6a9b250ad35aeab6408bed6eb1b74e0ca2 to the current head, then covered the full merge-base diff and surrounding code.
Validation: git diff --check passed for both the full and incremental committed diffs. No tests or builds were run per the static-review scope.
| Severity | Findings |
|---|---|
| P0 | 0 |
| P1 | 0 |
| P2 | 1 |
| P3 | 0 |
| Total | 1 |
This is an automated review by Codex GPT-5.6-Luna(max)
After addressing the findings or replying to the comments, you can request another review from me to trigger a new automated review.
4ca0260 to
d992c83
Compare
d992c83 to
474cf87
Compare
- Merge the user context over default contexts with QueryContexts.withDefaults, so a null user value falls back to the configured default on both the SQL and native paths. - Declare maxSubqueryBytes as a string parameter that accepts the forms the subquery guardrail accepts. - Deprecate the key constants replaced by descriptors for removal, and migrate their remaining uses. - Escape default descriptions and ignore CRLF line endings in the generated documentation check.
FrankChen021
left a comment
There was a problem hiding this comment.
🟢 Approval recommended
The current head preserves compatibility aliases and correctly handles typed query-context defaults and null semantics. No merge-blocking correctness issues were found.
Reviewed all 165 of 165 files in the current merge-base diff, including surrounding callers, tests, configuration/default precedence, MSQ/server paths, compatibility APIs, and generated documentation. The packet’s file metadata listed 100 entries, so the prepared worktree’s complete current-head diff was used as authoritative.
Validation: git diff --check 308c949996 16d18f372debd94d84d63fec0dbfce1aeb115c13 passed. No builds or tests were run.
This is an automated review by Codex GPT-5.6-Luna(max)
Description
Follow-up to #20198. Migrates the common query context parameters documented in
query-context-reference.md(andscan-query.md) to typedQueryContextParameterdescriptors.QueryContextParameterswith types, defaults, range constraints, deprecation metadata and documentation.QueryContextBuilderwhere tests build context maps.QueryContextBuilder.putRawfor keys that don't have a descriptor yet.query-context-reference.mdandscan-query.mdfrom the descriptors.Existing parameter names and defaults are unchanged.
Behavior changes
1.5, and values out of range, instead of truncating or wrapping them. Integral values such as5.0or"5.0"are still accepted. Invalid values fail withQuery context parameter [x] should be ....nullunsets a parameter:withOverriddenContext,withId(null)and the query builders'queryId(null)now remove the key, like the typed setters. Reads already treated an explicitnullas unset, so an explicitnullmaxScatterGatherBytesnow gets the server limit.nullin the query context, orSET x = NULL, no longer clears a default configured withdruid.query.default.contextor the Broker dynamic configuration. The default applies, as if the key were not set. Previously thenullreached readers, which used the built-in default. To override a configured default, set an explicit value.maxSubqueryBytesis a typed string parameter that acceptsauto,disabledor a non-negative number of bytes, as the subquery guardrail does. Invalid values such asSET maxSubqueryBytes = TRUEnow fail during validation, and numbers such as1e9are now accepted.Deprecations
The key constants replaced by descriptors are deprecated for removal: the migrated
QueryContexts.*_KEYconstants,BaseQuery.QUERY_IDandTimeseriesQuery.SKIP_EMPTY_BUCKETS. Use the correspondingQueryContextParametersdescriptors instead.This PR has: