← Back to Pull requests

[Spark] Add Delta V2 scan builder diagnostics #8066

Closed
unknown closed this pull request without merging on Nov 20, 2026 03:03 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 21:52 UTC
Author

Which Delta project/connector is this regarding?

  • Spark

  • Standalone

  • Flink

  • Kernel

  • Other (fill in here)
  • Description

    Add structured DEBUG diagnostics to the Delta V2 scan builder for filter classification, requested and pruned schemas, effective limits, scan construction, and deferred file selection. Summaries include redacted table context, counts, and elapsed time where available.

    Filter rendering is defensive: an expression whose .sql method throws retains its original partition/data-filter classification and gets a diagnostic placeholder. INFO logging does not render expressions. Build and deferred-selection failures emit bounded WARN summaries with the operation, redacted table path, exception class, and elapsed time. They omit stack traces and exception messages; existing failure events and original exception propagation are retained.

    The file-selection supplier stays deferred. The diff focuses on DeltaV2ScanBuilder and its existing test suite. Scope and severity review is requested in #8064.

    How was this patch tested?

    All 134 tests passed on Spark 4.1 / Scala 2.13: 43 scan builder tests, 85 scan tests, and 6 batch tests. The scan builder suite includes six new regression cases for throwing SQL renderers on data and partition filters, no rendering at INFO, redacted bounded warnings with original exception identity, and deferred selection at INFO and DEBUG.

    build/sbt -batch -DsparkVersion=4.1 \
      'sparkV2/testOnly *DeltaV2ScanBuilderTest *DeltaV2ScanTest *DeltaV2BatchTest'
    

    Java formatting, Scala style for the changed builder class, and whitespace checks passed.

    Does this PR introduce _any_ user-facing changes?

    Yes. The Delta V2 scan builder emits DEBUG planning summaries and bounded contextual WARN messages. Query results and the transaction-log format are unchanged.

    Diff: 233 lines (+174 / -59) across 2 files Reviewer: huan233usc Review duration: 14711m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 233 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.326
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8066"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 14.6% · Safe to merge
    14.6%
    Repository