Accelerate DML writes to DV-enabled tables on Databricks 17.3/18.3 [databricks] #16183
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16183"
general
weight: 0.35
sdrp713
Fixes #15993 .
Description
This PR enables GPU execution of Delta Lake
DELETE,UPDATE, andMERGEon deletion vector enabled tables in Databricks 17.3 and 18.3. Previously, commands that wrote persistent deletion vectors fell back to CPU execution. Supported operations now keep the data intensive scan, predicate evaluation, and changed row writes on the GPU while preserving Delta's native deletion vector and transaction handling.Implementation
DELETEandUPDATE, build compact per-file deletion bitmaps from GPU selected rows; combine them with existing DVs using DBR's native DV writer and transaction actions.MERGE, write changed rows on the GPU and update DVs for affected target rows without copying unaffected rows into replacement files. Existing duplicate match and clause behavior remains covered by integration tests.DELETE,UPDATE, andMERGE, when the target scan cannot run on the GPU: Parquet or the file scan disabled,spark.sql.legacy.parquet.nanosAsLong, or VARIANT/unsupported column types.MERGEalso falls back for row-tracked tables, matchingUPDATE. If a CPU scan still produces a null physical row index, the command fails instead of silently leaving matched rows undeleted.input_file_name()before the filter, so every row keeps its own file. Other conditions keep the filter-before-file-name path that allows predicate pushdown into the scan.processUnmodifiedDatatakes the data-skipping string prefix length).Testing
delta_lake_delete_test.py,delta_lake_update_test.py, anddelta_lake_merge_test.pyrun with 225 passed, 20 skipped, 16 xfailed, 97 xpassedtest_delta_merge_dv_clauses(CDF,NOT MATCHED BY SOURCE, duplicate-sourceDELETE) now runs on 17.3+.INsubquery conditions across multiple files (DELETEandUPDATE); scan-eligibility fallbacks forDELETE/UPDATE/MERGE(Parquet switches, file scan disabled,nanosAsLong);MERGEwith row tracking and persistent DVs; and a fragmented DV index only scan test for both reader types.| Runtime | Tests | Result |
| --- | --- | --- |
| DBR 14.3 | full
delta_lake_delete_test.py,delta_lake_update_test.py,delta_lake_merge_test.py| 150 passed, 0 failed || DBR 17.3 | DV-focused subset of the same three files | 161 passed, 0 failed |
| DBR 18.3 | DV-focused subset of the same three files; full
delta_lake_low_shuffle_merge_test.py| 162 passed; 363 passed, 0 failed |Delta Lake integration tests are still disabled in CI for DBR 18.3 (#16282), so DBR 18.3 is covered by these manual runs.
Performance
Measured on Databricks Runtime 17.3 (Spark 4.0.0) in local mode on one NVIDIA A10G, with the NDS SF3000
store_salessample stored on local disk. The input contained 15.07 GB of data; the materialized target was 16.28 GB, with 293.8 million rows and pre-existing DVs. Each command affected 29.38 million rows (about 10%). Timings include the DML command, not table preparation or result validation. One warmup was excluded; the table reports medians from three measured CPU/GPU pairs on the same machine.| Command | CPU median | GPU median | Speedup |
| --- | ---: | ---: | ---: |
| DELETE | 6.878 s | 6.254 s | 1.10x |
| UPDATE | 86.964 s | 38.516 s | 2.26x |
| MERGE | 586.259 s | 249.785 s | 2.35x |
##### AB Results
Workload used an NDS SF3000
store_salesparquet sample materialized as a deletion vector enabled Delta table. The prepared table had approximately 317.5 million rows and pre existing deletion vectors. DELETE, UPDATE, and matched update MERGE each affected approximately 10%.CPU and GPU ran with four g4dn.4xlarge workers and unchanged AB baseline settings.
| Operation | CPU median | GPU median | Speedup |
| --- | ---: | ---: | ---: |
| DELETE | 22.1 s | 22.6 s | 0.98× |
| UPDATE | 266.8 s | 186.0 s | 1.43× |
| MERGE | 519.25 s | 178.65 s | 2.907× |
The single broad UPDATE run (50% of rows, one run) took 249.0 s on GPU against 894.4 s on CPU, about 3.6× speedup.
##### Fragmented deletion vectors
An index-only target scan (
MERGE ... ON t.p = s.p WHEN MATCHED THEN DELETE) over a single 4M-row file with alternating deleted rows, so every surviving row is its own range. Each run uses a freshly written table, on one A10G in local mode, after a small warm-up:| Deletion vector | Before | After |
| --- | ---: | ---: |
| Fragmented (alternating rows) | 398.1 / 390.2 / 417.1 s | 5.00 / 4.19 / 5.15 s |
| Contiguous (control) | 4.01 / 4.04 / 3.99 s | 4.51 / 3.85 / 3.88 s |
This is a worst case; most of the remaining ~4 s is fixed
MERGEoverhead. Typical scattered deletions produce fewer ranges, so the gain is smaller.Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance