← Back to Pull requests

fix: preserve current SQL configs when captured keys are unset #7348

Open
unknown opened this pull request with 173 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 30, 2026 18:20 UTC
Author

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.withConf mistakes 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?

  • Before the fix the regression returned (stale, missing) instead of (missing, current).

  • The regression and its controls passed under Spark 4.1 and Spark 3.5, with one test executed on each profile.

  • make format, make and git diff --check passed in an isolated Linux environment using JDK 17.
  • The remaining Spark profiles and upstream Spark SQL suites were not run locally.

    Diff: 173 lines (+129 / -44) across 2 files Reviewer: sunchao Review duration: 2409m
    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
    0.58
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 58.5% (MEDIUM) · Higher = larger blast radius
    58.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.2% · Safe to merge
    31.2%