← Back to Pull requests

[Spark] Convert SnapshotManagerFactory to Scala #8055

Closed
unknown closed this pull request without merging on Nov 16, 2026 22:44 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 16:54 UTC
Author

Which Delta project/connector is this regarding?

  • Spark

  • Standalone

  • Flink

  • Kernel

  • Other
  • Description

    Convert SnapshotManagerFactory from a Java utility class to a Scala object and accept Option[CatalogTable]. Scala callers can pass catalog metadata directly, while Java callers use Scala Option. Preserve catalog selection, lookup timing, exceptions, and lazy path-based fallback.

    Keep the factory scoped to the v2 connector. Adapt the existing cache tests to scoped Scala-object spying, add the required test dependency, and open the Java reflection module for those tests on Java 17. Existing test cases and assertions are unchanged.

    How was this patch tested?

    Validated rebased head dc2784b985f00d6543dd3be6a563d181e7be1b8e against master ef61df0920cec80f49c2142719f823dbf626c6ad on Java 17 with Spark 4.2:

    build/sbt -DsparkVersion=4.2 \
      "sparkV2/testOnly org.apache.spark.sql.delta.v2.tablemanager.CachedSnapshotManagerSuite org.apache.spark.sql.delta.v2.snapshot.unitycatalog.UCUtilsSuite" \
      "spark/Test/compile"
    

    All 42 tests passed: 35 cache tests and 7 UC utility tests. Unified compilation, including both Java changelog callers, and git diff --check passed. The rebase preserves the seven-file contribution scope and all existing assertions.

    Does this PR introduce _any_ user-facing changes?

    No.

    Diff: 172 lines (+129 / -43) across 2 files Reviewer: huan233usc Review duration: 10430m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 172 lines diff across 2 files
    0.35
    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.308
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8055"
    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: 35.3% (MEDIUM) · Higher = larger blast radius
    35.3%
    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: 13.9% · Safe to merge
    13.9%
    Repository