Return null for json_tuple NULL field names [databricks] #17219
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 · 434 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.363
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #17219"
general
weight: 0.35
firestarman
JaCoCo production line coverage: +21 lines (
sql-plugin +21; shim 330, single-run fix-line measurement with the json_tuple operator tests)Fixes #17068.
Description
GPU
json_tuplecould read an empty-string JSON key when a requested field name was SQLNULL, silently returning a value where Spark returns null. NULL field names now produce null columns; explicitly requested empty names still match empty keys, and valid and repeated names retain their original output positions.The fix checks the field scalar's cached validity before constructing extraction paths, sends only valid names to the existing matcher, and restores null columns in their requested positions. All-NULL names skip extraction. The tests cover mixed and all-NULL names, output ordering, empty keys, duplicate names and keys, null/malformed JSON, and nested values at 1 KiB and 1 MiB batch sizes; each new case requires
GpuGenerateExec.Local validation used JDK 17, Python 3.10, and an RTX 5880 Ada GPU:
| Runtime | Validation | Result |
|---|---|---|
| Spark 3.3.0 / Scala 2.12 | Distribution build; all
json_tuple_test.pytests and everyjson_tuplecase injson_matrix_test.py| Build passed; 56 passed, 1 existing xfailed || Spark 4.0.5 / Scala 2.13 | Same build and operator test selection | Build passed; 56 passed, 1 existing xfailed |
| Both runtimes | 14 expanded CPU-first/GPU shell comparisons with executed GPU plans, before the naming-only review update | 14 passed per runtime |
| Spark 3.3.0 | Fresh JaCoCo run of the complete json_tuple operator selection | 56 passed, 1 existing xfailed; 21 added/modified production lines covered |
The retained xfail is
nested_escaped_strings.json. ScalaStyle passed with zero errors and warnings. The single-run fix-line measurement includes the only JVM production module changed by this PR and uses classfiles matching the loaded distribution.Spark 4.0.5 additionally has a CPU whole-stage-codegen issue in the original
CASE WHENreproduction: for a null JSON row, its ordinary-name output can retain the preceding row's value. This was reproduced without RAPIDS, including with the missing-name control. The NULL-name column is fixed here; full original-query parity on Spark 4 was verified with whole-stage codegen disabled, while the materialized-input regressions above pass with normal codegen.Performance was checked against unmodified main with one million JSON rows, cached input, 1 MiB batches,
local[2], AQE disabled, and 20 warmups plus 20 measured samples per workload in separate JVMs. Median latency was 61.459 → 53.432 ms for one valid field and 78.216 → 73.476 ms for eight valid fields. No slowdown was observed in these local workloads; these measurements do not establish a general speedup. The naming-only review update leaves the disassembled runtime instructions unchanged.AI assistance: The change, regression tests, validation, independent defensive review, and PR description were prepared with Codex assistance.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance