feat: add experimental sys.query_context_parameters system table #20586
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 501 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20586"
general
weight: 0.35
GWphua
Description
Follow-up to #20555, #20578 and #20579 .
Adds
sys.query_context_parameters, which lists the query context parameters users can set, built from theQueryContextParameterscatalog.SYSTEMparameters, which only Druid sets, are excluded. This PR also renames theVisibility.INTERNALlevel added in #20555 toSYSTEM;Visibilityhas not been released yet. Descriptions are normalized to one line when the descriptor is built.The table is documented as experimental, so that its columns and their values can still change in future releases.
Descriptor changes
QueryContextParameterdeclares its default as aDefaultValue: none, a literal, or a runtime property (DefaultValue.fromProperty("druid...")).getDefaultValue()returns it, andgetLiteralDefault()returns the literal default or null. Parameters whose default is the value of a runtime property, such astimeout,maxQueuedBytesand the SQL planner parameters backed bydruid.sql.planner.*, now declare that property instead of describing it indefaultDescription.nullandN/Aare removed, sodefault_descriptiononly explains defaults that can't be expressed as a single value., inferred from the value type when the descriptor is built, is what thetypecolumn shows. A value type without a corresponding type is rejected.| Column | Type |
|---|---|
| name
,type,value_range,default_value,effective_value,effective_source,default_description,description,visibility,since,deprecation| VARCHAR |query_languages|
(SQL,JSON),engines,native_query_types,statement_types| ARRAY<VARCHAR> |is_nullable|
| BIGINT |is the built-in default, or${property}, such as${druid.server.http.defaultQueryTimeout}, for a default that is the value of a runtime property.is the default this Broker applies when a query doesn't set the parameter: the Broker dynamic configuration'squeryContext, else thedruid.query.default.context.<name>runtime property, else the runtime property indefault_valueas set on this Broker, else the built-in default.says which:BROKER_DYNAMIC_CONFIG,DEFAULT_CONTEXT_PROPERTY,RUNTIME_PROPERTYorBUILT_IN. Anullin the dynamic configuration unsetsdruid.query.default.context.<name>.QueryConfigProvidergainsgetContextWithOverrides(), which returns the effective context and the dynamic overrides from one config snapshot, so the table can tell them apart.uses the nativequeryTypenames, such asscanandgroupBy.andstatement_typesare empty when a parameter applies to all native query types or statement types, and null when it doesn't apply to native queries or SQL at all.the demo of the table (after the web console support is added)
<img width="1380" height="571" alt="image" src="https://github.com/user-attachments/assets/e5d681b9-c7b6-4e35-8ef3-74c91836125d" />
Authorization
Unlike sys.servers
, the table doesn't requireSTATEREAD: any user who can querysystables can read the catalog. Only the effective defaults come from Broker configuration, so withoutREADon theCONFIGresource the query still succeeds, buteffective_valueis null andeffective_sourceisUNAUTHORIZED` in every row.<hr>
This PR has: