Accelerate Delta Lake 4.3 selective replacement with replaceOn and replaceUsing [databricks] #16619
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 469 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.368
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16619"
general
weight: 0.35
sdrp713
Fixes #16280.
Description
Accelerated Delta Lake 4.3 selective replacement with
replaceOnandreplaceUsing, including matching against tables with persistent deletion vectors.Reused upstream validation, expression resolution, source materialization, retry, and cleanup behavior while executing supported matching and writes on the GPU. Preserved CDF, constraints, commit metadata, metrics, and atomic partial overwrite semantics. Also fixed statistics collection for quoted column names.
Added coverage for V1 write APIs, column resolution, subqueries, DVs, CDF, partitioned tables, empty sources, retries, failure cleanup, command/operator fallback, and disabled writer feature flags. Added user-facing documentation covering setup, examples, API semantics, fallback behavior, and upstream limitations.
Validation (November 16): 41 CPU/GPU integration cases passed locally on Spark 4.1.1 with Delta 4.3.0 and an NVIDIA RTX 6000 Ada. Another 39 Scala unit tests passed across Spark 4.0.1 and 4.1.1, with one expected version-specific skip. These checks covered the changes combined with upstream/main. Standard premerge does not run these selective replacement Python tests; no nightly pass has been verified.
Performance: AB testing on spark2a on November 17 with 100M target rows, 1.1M source rows, and ten runs per arm. The baseline was CPU execution (
spark.rapids.sql.enabled=false), compared against GPU execution with matched resources. Each measurement used a fresh target clone, with unmeasured warmups and balanced CPU/GPU and operation ordering.| Operation | CPU/GPU speedup | 95% confidence interval | AB p-value |
|---|---:|---:|---:|
| replaceUsing, without DVs | 1.14x | 1.054–1.237x | 0.00255 |
| replaceOn, without DVs | 1.11x | 0.992–1.243x | 0.06609 |
| replaceUsing, with DVs | 1.09x | 1.032–1.156x | 0.00407 |
| replaceOn, with DVs | 1.02x | 0.865–1.198x | 0.82356 |
Only replaceUsing without DVs meets both AB’s default statistical significance and 500 ms improvement thresholds. The confidence intervals exclude a 10% GPU slowdown for the first three cases; replaceOn with DVs remains inconclusive. These are four unadjusted comparisons. Ratio confidence intervals were calculated separately using the same equal-variance t-test assumptions as AB.
Native internal DELETE metrics for the non-DV cases:
| Operation | Arm | Mean scanTimeMs | Mean rewriteTimeMs | numCopiedRows | Files touched |
|---|---|---:|---:|---:|---:|
| replaceUsing | CPU | 1862.8 | 2943.9 | 99,000,000 | 1,024/1,024 |
| replaceUsing | GPU | 1801.9 | 2290.7 | 99,000,000 | 1,024/1,024 |
| replaceOn | CPU | 1857.4 | 2944.1 | 99,000,000 | 1,024/1,024 |
| replaceOn | GPU | 1952.2 | 2300.1 | 99,000,000 | 1,024/1,024 |
Although only 1% of target rows matched, both non-DV operations touched every target file and copied 99M retained rows. Most of the GPU improvement came from rewriting these rows. The source was broadcast. DELETE phase timings exclude setup, warmups, and insertion. The native DV DELETE path does not populate these phase timers, so its reported zeros are not measured zero durations.
All 80 measured operations passed result validation, and GPU runs were checked for GPU matching, target scans, and writes.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance