← Back to Pull requests

Fall back safely for shredded VARIANT reads in DBR and OSS Delta [databricks] #16424

Closed
unknown closed this pull request without merging on Oct 20, 2026 04:51 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 20:54 UTC
Author

Fixes #16423.

Description

Delta scans reading shredded VARIANT columns can select the GPU path and fail with SchemaColumnConvertNotSupportedException. This affects DBR 17.3 and was also reproduced on OSS Spark 4.0.4 with Delta Lake 4.0.1.

Use typed Delta feature APIs to detect shredding support from the table protocol. VARIANT reads fall back to CPU for shredding or unknown reader features. Eligible reads from non-shredding tables and ordinary-column projections retain GPU eligibility. Protocol checks remain effective after shredded writes are disabled.

Correctness validation

Local validation using source-recompiled diagnostic jars passed:

Tests compare CPU/GPU results and assert operator placement. Coverage includes feature-free, feature-only, shredded, write-disabled, and mixed-file tables, nested VARIANT, extraction, aggregation, ordinary-column projections, pushdown and plain Parquet controls.

Performance validation

Tested OSS Spark 4.1.1 + Delta Lake 4.1.0 on an RTX A5000 (24 GiB), using local[4] and a 6 GiB driver heap. AQE and VARIANT extraction pushdown were disabled; shredded reading remained enabled.

Each table contains four million rows across 16 Snappy Parquet files, approximately 291 MB compressed. Measurements use warm OS caches without DataFrame caching. Each query/mode has three warm-up rounds and seven measured rounds in each of two independent JVMs: 14 measured samples per query/mode.

Baseline and patched sessions were alternated. Native CPU runs provide a reference. All 252 measured actions and 108 warm-up actions passed checksum validation. Operator-placement checks confirmed the expected CPU fallback and GPU eligibility.

Median timings in milliseconds. Planning includes relation creation, analysis, and physical planning; execution measures collection after physical planning. JVM startup is excluded.

| Workload | Planning: baseline → patched | Execution: baseline → patched | Native CPU execution |
|---|---:|---:|---:|
| Projected VARIANT extraction followed by SUM, no shredding feature | 102.6 → 121.6 | 889.1 → 242.7 | 823.5 |
| Inline SUM(try_variant_get(...)), no shredding feature | 78.5 → 79.9 | 837.6 → 841.7 | 814.0 |
| VARIANT SUM, feature-bearing unshredded table | 80.0 → 78.5 | 837.6 → 828.7 | 814.2 |
| VARIANT SUM, shredded table | 79.4 → 79.8 | 1145.5 → 1135.7 | 1177.1 |
| Ordinary-column SUM, feature-free table | 77.7 → 78.0 | 97.8 → 96.1 | 56.2 |
| Ordinary-column SUM, shredded table | 78.3 → 77.1 | 98.5 → 98.1 | 54.5 |

Projected extraction uses GPU scan, GpuVariantGet, and GPU aggregation, improving median execution time by 3.66×. Its median planning time increases by 19.0 ms.

Implementation, tests, and performance validation were developed with AI assistance.

Checklists

Documentation

  • Updated for new or modified user-facing features or behaviors

  • No user-facing change
  • Testing

  • Added or modified tests to cover new code paths

  • Covered by existing tests

  • (Please provide the names of the existing tests in the PR description.)
  • Not required
  • Performance

  • Tests ran and results are added in the PR description

  • Issue filed with a link in the PR description

  • Not required
  • Diff: 411 lines (+308 / -103) across 5 files Reviewer: sdrp713 Review duration: 476m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 411 lines diff across 5 files
    0.45
    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.360
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #16424"
    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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    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: 17.7% · Safe to merge
    17.7%