Fix Delta write GPU planning with AQE on DBR 17.3 [databricks] #16376
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 248 lines diff across 3 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.330
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16376"
general
weight: 0.35
gerashegalov
Fixes #16372.
Description
With AQE enabled on DBR 17.3, Delta UPDATE and MERGE operations can retain the CPU write stub because AQE insertion skips the remaining preparation rules. This causes unintended row execution and CPU optimized-write exchange selection.
Apply the normal columnar rules to the unreplaced write stub after AQE insertion, preserving QueryExecution ownership, shuffle-cleanup policy, and intentional metadata-query fallback. Also remove duplicate driver updates to the optimized-write partition counter, which shuffle-read tasks already update preventing Databricks SQL metrics conflicts.
AI assistance: Codex assisted with implementation and validation. The author reviewed and approved the complete changes before posting the PR.
<details>
<summary>Validation and performance results</summary>
Validated on DBR 17.3 / Spark 4.0 / Scala 2.13 / Tesla T4:
Focused 10-million-row Parquet-to-Delta comparison using local[2], with eight timed writes per artifact/AQE mode after warmups across paired fresh sessions:
| AQE | Baseline median | Patched median | Elapsed-time change |
| --- | ---: | ---: | ---: |
| Enabled | 11.058 s | 9.559 s | -13.6% |
| Disabled | 9.340 s | 9.050 s | -3.1% |
</details>
Checklists
Documentation
Testing
Performance