Return null for get_json_object array indexes above Int.MaxValue #17217
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.46) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 470 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.344
Real PR Conversation Timeline
1 comments
"Review active on #17217"
general
weight: 0.35
thirtiseven
JaCoCo production line coverage: +8 lines (
sql-plugin +8; shim 330, fix-line,GetJsonObjectLargeIndexSuite)Fixes #17060.
Description
get_json_objecton GPU failed the Spark task for an array index aboveInt.MaxValue, such as$[2147483648]. Spark parses that index as a long and returns SQL null because the element is missing. The GPU path passed the long into a 32-bit JNI instruction, which throwsIllegalArgumentException: index is too largebefore the extraction kernel starts.Indexes that do not fit in a 32-bit int are now treated as no match. The single
get_json_objectexpression and a combined projection both produce a null column for that path and leave any sibling in-range path on the GPU. Indexes that fit, includingInt.MaxValue, still go through the existing kernel. The JNI range check is unchanged, so a truncated index cannot silently select element 0.An index that does not fit in a long still fails path parsing on both CPU and GPU. This does not change
json_tuple.Cold-path performance impact
The added check (
GpuGetJsonObject.hasIndexBeyondInt, called only fromGpuGetJsonObject.pathForJni) is strictly cold-path and does not run per row or per batch during steady-state execution:GpuMiscExpressionOverridesrequirespathto be a literal string (TypeSig.lit(TypeEnum.STRING)), andGpuGetJsonObjectMeta.tagExprForGpu()rejects paths with more thanJsonPathParser.MAX_PATH_DEPTH = 16filtered instructions (at most 32 rawPathInstructiontokens beforefilterInstructionsForJni).GetJsonObjectCombiner.multiGet):pathForJniexecutes once per expression during driver-side query planning when constructingGpuMultiGetJsonObject. The per-batch execution path (GpuMultiGetJsonObject.columnarEval) is unchanged.GpuGetJsonObject.doColumnar):pathForJniexecutes insidecachedInstructions.getOrElse { ... }at most once per task instance (on the first batch); all subsequent batches reusecachedInstructionswithout re-scanning.pathForJnireturns the identicalOption[List[PathInstruction]]and executes the exact same JNI/GPU kernel calls with zero additional allocations, branches, synchronization, or GPU memory usage. For out-of-range indexes (> Int.MaxValue), execution previously failed withIllegalArgumentExceptionand now takes the existing null-column fast path without launching the extraction kernel.Validation
GetJsonObjectLargeIndexSuitepassed on shim 330 with Java 17: 9 tests, 0 failures. It covers an in-range index,Int.MaxValue, the first index above it, leading zeros,Long.MaxValue, a nested miss, and two combined projections, and compares CPU and GPU results. Premerge CI (GitHub Actions and Blossom) passed on commitb9edb753383e.AI assistance: The change and PR description were prepared with Cursor assistance.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance
Cold-path only:
pathForJniruns once during driver planning (GetJsonObjectCombiner.multiGet) or once per task (GpuGetJsonObject.doColumnarviacachedInstructions) on a depth-bounded literal path, leaving per-batch GPU execution unchanged (see Cold-path performance impact above).