[FEA] Support Variant values in array and map lookups #16446
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 #16446"
general
weight: 0.35
sdrp713
Contributes to https://github.com/NVIDIA/cudf-spark/issues/15559.
Stacked on #16445.
Description
This PR enables
GetArrayItemandGetMapValueto return Variant values on GPU.It allows Variant values stored in arrays and map values to reach the existing GPU Variant extraction implementation.
Performance tests (original revisions)
The measurements below use the original revisions recorded in the tables and details. They have not been rerun after this stack update.
On an NVIDIA L4 with Spark 4.1.1 (
local[8]), array lookups were 1.60–2.93x faster and map lookups 2.12–2.99x faster; the unchanged struct control had nearly identical median times.Baseline
c9327856c→ PR9cbe8dcaf. Times are median seconds across five measured iterations after two warm-ups. Speedup = baseline / PR; values below 1.0 mean slower. Padding is per Variant value.| Rows / padding / files | Query | Baseline (s) | PR (s) | Speedup |
| --- | --- | ---: | ---: | ---: |
| 1M / 64 B / 8 | array | 0.500 | 0.312 | 1.60x |
| 1M / 64 B / 8 | map | 0.534 | 0.252 | 2.12x |
| 1M / 64 B / 8 | struct (control) | 0.200 | 0.199 | 1.01x |
| 200k / 4 KiB / 8 | array | 1.013 | 0.346 | 2.93x |
| 200k / 4 KiB / 8 | map | 1.028 | 0.344 | 2.99x |
| 200k / 4 KiB / 8 | struct (control) | 0.163 | 0.163 | 1.00x |
Implementation and validation
GetStructFieldalready accepted Variant results, but the type signatures forGetArrayItemandGetMapValuerejected Variant children.This change:
GetArrayItemandGetMapValue;Test-only regression-review sync at
e4d64f9267406a8bce1b9e27f0ba9212a2153d64(2026-11-02):Merged #16445 at
64477b5d94cfda47e85ae78df21121c2510cee7a. Relative toeab09f28e, only the inherited Python read-test coverage changes; production sources are unchanged. The parent review added six field-ID/name-mapping and nested schema-evolution cases across three reader modes. Its focused shared-reader regression runs passed 31 cases on Spark 3.5.9 / Iceberg 1.9.2, 60 on Spark 4.0.4 / Iceberg 1.10.1, and 69 on Spark 4.1.1 / Iceberg 1.11.0: 160 passed, zero failures/errors/skips. This does not replace a separate runtime test of the downstream-specific combination.This final head passed all 32 shim profiles against
mainat5693fed7121f1747914562c7ec7a26f87aadeaa7, with no static findings. The independent bounded advisory had four combinations without new interactions, one incomplete peer+target conflict (#16595), and 49 unchecked candidates. Earlier revision-specific build/runtime/performance evidence below retains its original scope.Correctness follow-up sync at
eab09f28ed426cb3ec883503328b48c1757688c6(2026-11-02):025c4f1c720e50bdf0b61d70861d12752914e648, preserving review history. The six inherited files exactly match #16445's physical-name matching and unannotated-Variant fallback fixes, including the new regressions.UTCandAsia/Shanghaiat the production revision recorded in #16445. The final parent only adjusts the Python fixture, with identical production sources. This downstream combination was not separately rebuilt or runtime-tested; the downstream-specific evidence below remains tied to its listed revisions.mainat5693fed7121f1747914562c7ec7a26f87aadeaa7, with no static findings. The independent bounded advisory completed four joint static checks without new interaction findings. #16595 was incomplete because its peer+target source tree conflicts; 49 candidates were not checked. These static checks do not establish runtime compatibility.Review-fix stack sync (2026-11-02) at
1fb18ac125838294735efaea549bf9740e721541:9ebfc2fea4bf057728f3dd4c35e29f92c089333b, preserving review history. Relative tod57132727979ccd76a57d69fe041ba50adacf52f, the only changes are 21 inherited Python test lines restoring encrypted-Variant fallback coverage and the three row-lineage fast-suite cases; production sources are unchanged.UTCandAsia/Shanghai(4 cases per timezone), and fast-suite collection selected all three row-lineage readers. No new downstream build or runtime run was performed for this test-only merge; the evidence below remains tied to its recorded revisions.mainat5693fed7121f1747914562c7ec7a26f87aadeaa7, with no static findings. The independent bounded advisory found no new static interaction findings with #16687, #16688, #16697, or the pre-fix #16445 head. #16595 could not be checked because its source tree conflicts with main; another 50 candidates were not checked. Static checks do not establish runtime compatibility.Rebase validation (2026-11-02) at
d57132727979ccd76a57d69fe041ba50adacf52f:fix/iceberg-variant-readate8326f18fd23594f80031c67a4b17abcf0a5a7bb, preserving the existing stack dependency and non-UTC test allowances.b668190426a96d6e300ee5a36e7b74995104f7bepassed a JDK 17 / Scala 2.13 / Spark 4.1.1 cleantests,dist,integration_tests -am installwith-DskipTests: test sources compiled and distribution audits passed; Scala unit tests were not executed in this run.test_parquet_nested_array_map_variant_try_getandtest_iceberg_v3_nested_variant_readboth passed with Iceberg 1.11.0,TZ=UTC, seed 42, and OOM injection disabled: 2 passed, 0 failed, 0 errors, 0 skipped.mainat5693fed7121f1747914562c7ec7a26f87aadeaa7, with no static findings. The independent advisory found no new static interaction findings in four checked peers; one peer combination had conflicting source trees and 49 candidates exceeded the bounded checking scope. These checks do not establish runtime coverage for other Spark versions.Earlier validation at
0c43e621c9930538819869a892046ab531d44069after merging the updated parent PR, using JDK 17, Spark 4.1.1, Scala 2.13 and Iceberg 1.11.0:tests,dist,integration_testsreactor install with test compilation and distribution audits: passed. Versioned generated sources were cleaned before rebuilding.GpuIcebergVariantSchemaSuite: 10 passed;GpuIcebergVariantPostProcessorSuite: 6 passed.ICEBERG_EXTRA_CLASSPATH, with zero failures, errors or skips. Coverage includes top-level extraction, direct scalar/null reads, both shredded-reader settings and encrypted-table fallback.test_parquet_nested_array_map_variant_try_get: 1 passed; the captured plan containsGpuGetArrayItem,GpuGetMapValueandGpuVariantGet.Build/package command (JDK 17, with a separate local Maven repository per checkout):
The Scala suites and Python regressions listed above were run separately after packaging.
<details>
<summary>Performance test details</summary>
Revisions and environment
c9327856c0b25ec86d66f308bcf8727bcab4129d; PR:9cbe8dcaf667f8a056b90f093926d605baa29c94. Both runs enabled RAPIDS and kept the default CPU bridge enabled.local[8], 12 GiB driver memory, four concurrent GPU tasks, 2 GiB pinned memory, 128 MiB target GPU batches.mvn -B -f scala2.13/pom.xml install -Dbuildver=411 -Dincluded_buildvers=411 -DskipTests; functional validation was run separately.Data and queries
CPU-generated, Snappy-compressed Parquet, read through the V1 source. Data was generated once on CPU and reused unchanged. The datasets have 1,000,000 rows with 64-byte padding, or 200,000 rows with 4,096-byte padding. Each dataset has eight files.
The logical schema is:
Each Variant contains an object or array with an integer and padding derived from a row-specific SHA-256 hex string, repeated to the requested length. Padding size is not the entire serialized Variant size; the repeated padding is compressible. Each case includes 1% SQL-null Variant values, 1% JSON-null Variant values, and 1% empty Variant objects/arrays.
The three workloads project these expressions, then aggregate row count, non-null count, and sums to consume the extracted integers:
items[1]indexes the outer SQL array (GetArrayItem/GpuGetArrayItem);attributes['array']indexes the SQL map (GetMapValue/GpuGetMapValue). The JSON paths insidetry_variant_getare evaluated byGpuVariantGetwhen GPU execution is selected.Configuration and measurement
Each revision ran two warm-ups followed by five measured iterations per case, baseline first and PR second. A fresh DataFrame/query was constructed for every action to prevent reuse of a previous shuffle result. Timings include planning, scan, extraction, aggregation, and collection, and exclude data generation and JVM startup. Every warm-up and measured result was checked against deterministic expected counts and sums; captured physical plans were also checked.
No Spark persistence or RAPIDS file cache was used; the OS page cache was warm. These are local, synthetic, unshredded-Variant microbenchmarks, so the results do not establish performance for remote storage, cold caches, shredded data, or arbitrary production workloads.
Observed execution
Both revisions used a GPU Parquet scan and
GpuVariantGet. The baseline performed collection access throughGpuCpuBridgeExpressionwrappingGetArrayItem/GetMapValue; the PR usedGpuGetArrayItem/GpuGetMapValuedirectly. The struct query follows an unchanged path and serves as a control.</details>
AI assistance disclosure: Codex assisted with implementation and validation.
Checklists
Documentation
Testing
(Please provide the names of the existing tests in the PR description.)
Performance