fix: preserve current SQL configs when captured keys are unset #7348
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.58) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.58 · 173 lines diff across 2 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.309
Sensitive Paths
sensitive_paths
0.058
Real PR Conversation Timeline
1 comments
"Review active on #7348"
general
weight: 0.35
sunchao
Which issue does this PR close?
Closes #7312.
Rationale for this change
A captured Comet setting may be unset on the session after a plan is cached. Inside a later SQL execution Spark propagates the current SQL configuration to the task, but if none of the captured keys remains set,
CapturedSQLConf.withConfmistakes the absence of those keys for an unpropagated configuration and reinstalls the stale capture.What changes are included in this PR?
As proposed in #7312, skip the captured configuration when the task has a SQL execution id. The existing captured-key check remains for callers that propagate SQL configuration without an execution id, and non-SQL tasks continue to use the capture when needed.
A regression test builds a capture with only one key, unsets that key, and checks a second session setting inside an actual SQL execution task. It also checks the non-SQL fallback and an existing task property without a SQL execution id.
How are these changes tested?
(stale, missing)instead of(missing, current).make format,makeandgit diff --checkpassed in an isolated Linux environment using JDK 17.The remaining Spark profiles and upstream Spark SQL suites were not run locally.