Fall back safely for shredded VARIANT reads in DBR and OSS Delta [databricks] #16424
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
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
sdrp713
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
Testing
(Please provide the names of the existing tests in the PR description.)
Performance