You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "emecii (via GitHub)" <gi...@apache.org> on 2026/09/10 17:15:16 UTC

[PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

emecii opened a new pull request, #11052:
URL: https://github.com/apache/arrow-rs/pull/11052

   # Which issue does this PR close?
   
   - Closes #11050.
   
   # Rationale for this change
   
   An out-of-bounds list lookup and a present Variant null both produce null child columns after take. Without preserving index validity separately, shredded input turns missing list positions into valid Variant nulls, unlike unshredded input.
   
   # What changes are included in this PR?
   
   - Carry the list index validity mask through shredded path traversal.
   - Apply that mask to the output while preserving explicit Variant null elements as valid values.
   - Update list-like coverage and add a regression test distinguishing an empty list, an explicit null element, and a typed element.
   
   # Are these changes tested?
   
   Yes.
   
   - cargo test -p parquet-variant-compute
   - cargo clippy -p parquet-variant-compute --all-targets --all-features -- -D warnings
   - cargo fmt --all -- --check
   
   # Are there any user-facing changes?
   
   Yes. variant_get now returns an Arrow null for an out-of-bounds lookup on shredded list-like values, matching unshredded input semantics.
   
   # AI usage
   
   OpenAI Codex assisted with investigating the issue, generating the implementation and tests, running the listed local validation, and drafting this PR description.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5971562060

   run benchmark variant_kernels
   
   env:
     BENCH_FILTER: "^variant_get_list_index"
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "emecii (via GitHub)" <gi...@apache.org>.
emecii commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5690699961

   For #11052, I can add a benchmark-only PR covering list-index validity: in-bounds/missing indexes, explicit nulls, nested lists, List/ListView, sliced inputs, typed/Variant outputs, and a struct-only control. I'd compare identical fixtures on base/head and measure allocations separately from runtime.
   
   An initial local allocation probe shows additional bitmap-union costs on nullable paths, so shared-buffer cloning alone doesn't establish the cost. Does this cover the evidence you'd like before merging the fix?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5971562762

   🤖 Benchmark starting (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/11052#issuecomment-5971562060)
   
   **Target:** variant&#95;kernels
   
   **Sharding factor: 1** (1 workers).
   
   Comparing fix/variant-get-shredded-list-null-11050 (64240f600c2aa2e911b2a5e0f7c08d211d67566d) to 6d44c7c (merge-base) [diff](https://github.com/apache/arrow-rs/compare/6d44c7c5ec45eb54ba2517179bcda5f786aceb85..64240f600c2aa2e911b2a5e0f7c08d211d67566d)
   
   <details><summary>Run configuration</summary>
   
   ```yaml
   run benchmark variant_kernels
   env:
     BENCH_FILTER: ^variant_get_list_index
   shards: 1
   
   ```
   
   </details>
   
   Results will be posted when all workers finish.
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
   
   <!-- benchmark-request:5971562060:start:4df9e04df5fb18eab5f360e9b7af4c8b -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-6419687581

   Thanks @emecii everything looks great! 
   
   We could optimize all OOB case by adding a fast-path to avoid using `take` if the `take_indices` array is empty.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5763836840

   That'd be great @emecii. Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub) via github" <gi...@arrow.apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-6840044709

   I'll open a new PR using @emecii commits then


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "emecii (via GitHub)" <gi...@apache.org>.
emecii commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5807160814

   The focused benchmark follow-up is implemented and pushed at [emecii:bench/variant-list-validity-11052](https://github.com/emecii/arrow-rs/commit/204ad24c6a6ca6fdbf6958aad90c80604ec8c5a4) (benchmark-only).
   
   Identical fixtures ran at `f9e02ba7` / `d881317d` in separate builds: 104 Criterion cases, plus five allocation samples per case in a separate executable. All head cases pass strict value/validity checks; 32 baseline cases are explicitly marked as the known missing-index bug.
   
   One concrete tradeoff: the 64-row all-OOB Int64 case has equivalent output but adds 5 allocations / 224 requested bytes. A reverse-order repeat measured 1.000 µs [95% CI 0.996–1.004] → 1.238 µs [1.230–1.246], about +24% (Apple M4, Rust 1.98.0, optimized; 50 samples, 1 s warm-up, 3 s measurement). At 8192 rows, mixed/nested List paths add 2/4 allocations and 1080/2160 bytes; their Variant outputs have corrected semantics. This is not a claim of overall performance neutrality.
   
   The benchmark branch passes 367 unit tests, Clippy, formatting, and all 104 benchmark preflights. Commands and measurement boundaries are in the added benchmark README.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5689048732

   Filed here - https://github.com/apache/arrow-rs/issues/11101


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5961399213

   @emecii could you merge the latest changes from main so I can run the new benchmark here? We'll move from there


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub) via github" <gi...@arrow.apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-6669100059

   @emecii could you also enable CI on your fork?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "Jefffrey (via GitHub) via github" <gi...@arrow.apache.org>.
Jefffrey closed pull request #11052: fix(variant): preserve nulls for missing shredded list indexes
URL: https://github.com/apache/arrow-rs/pull/11052


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5626170948

   I'll take a look tomorrow


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "adriangbot (via GitHub)" <gi...@apache.org>.
adriangbot commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5971626295

   🤖 Benchmark completed (GKE) | [trigger](https://github.com/apache/arrow-rs/pull/11052#issuecomment-5971562060)
   
   **Target:** variant&#95;kernels
   
   Comparing fix/variant-get-shredded-list-null-11050 (64240f600c2aa2e911b2a5e0f7c08d211d67566d) to 6d44c7c (merge-base) [diff](https://github.com/apache/arrow-rs/compare/6d44c7c5ec45eb54ba2517179bcda5f786aceb85..64240f600c2aa2e911b2a5e0f7c08d211d67566d)
   
   <details><summary>Run configuration</summary>
   
   ```yaml
   run benchmark variant_kernels
   env:
     BENCH_FILTER: ^variant_get_list_index
   shards: 1
   
   ```
   
   </details>
   
   <details><summary>Details</summary>
   
   ```
   group                                           base                                   changed
   -----                                           ----                                   -------
   variant_get_list_index_all_oob_int64_64_rows    1.00  1771.5±41.99ns        ? ?/sec    1.21      2.1±0.07µs        ? ?/sec
   variant_get_list_index_shredded                 1.00     45.6±1.57µs        ? ?/sec    1.00     45.7±1.60µs        ? ?/sec
   variant_get_list_index_unshredded               1.04  1031.4±13.98µs        ? ?/sec    1.00   992.5±14.29µs        ? ?/sec
   
   ```
   
   </details>
   
   <details><summary>Per-runner information</summary>
   
   <details><summary>variant&#95;kernels — shard 1/1</summary>
   
   **Node:** gk3-benchmark-cluster-nap-4ffvevr1-a4e5654c-8f6d
   
   **Instance:** c4a-highcpu-48 (12 vCPU / 65 GiB)
   
   **uname:**
   
   ```text
   Linux bench-c5971562060-3049-nbzbj 6.12.94+ #1 SMP Wed Aug 19 07:47:20 UTC 2026 aarch64 GNU/Linux
   ```
   
   **BENCH_COMMAND:**
   
   ```sh
   cargo bench --features=arrow,async,test_common,experimental,object_store --bench variant_kernels
   ```
   
   <details><summary>CPU Details (lscpu)</summary>
   
   ```text
   Architecture:                            aarch64
   CPU op-mode(s):                          64-bit
   Byte Order:                              Little Endian
   CPU(s):                                  48
   On-line CPU(s) list:                     0-47
   Vendor ID:                               ARM
   Model name:                              Neoverse-V2
   Model:                                   1
   Thread(s) per core:                      1
   Core(s) per cluster:                     48
   Socket(s):                               -
   Cluster(s):                              1
   Stepping:                                r0p1
   BogoMIPS:                                2000.00
   Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
   L1d cache:                               3 MiB (48 instances)
   L1i cache:                               3 MiB (48 instances)
   L2 cache:                                96 MiB (48 instances)
   L3 cache:                                80 MiB (1 instance)
   NUMA node(s):                            1
   NUMA node0 CPU(s):                       0-47
   Vulnerability Gather data sampling:      Not affected
   Vulnerability Indirect target selection: Not affected
   Vulnerability Itlb multihit:             Not affected
   Vulnerability L1tf:                      Not affected
   Vulnerability Mds:                       Not affected
   Vulnerability Meltdown:                  Not affected
   Vulnerability Mmio stale data:           Not affected
   Vulnerability Reg file data sampling:    Not affected
   Vulnerability Retbleed:                  Not affected
   Vulnerability Spec rstack overflow:      Not affected
   Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
   Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
   Vulnerability Spectre v2:                Mitigation; CSV2, BHB
   Vulnerability Srbds:                     Not affected
   Vulnerability Tsa:                       Not affected
   Vulnerability Tsx async abort:           Not affected
   Vulnerability Vmscape:                   Not affected
   ```
   
   </details>
   
   <details><summary>Resource Usage</summary>
   
   **base (merge-base)**
   | Metric | Value |
   |--------|-------|
   | Wall time | 40.0s |
   | Peak memory | 311.1 MiB |
   | Avg memory | 18.6 MiB |
   | CPU user | 35.7s |
   | CPU sys | 0.1s |
   | Peak spill | 0 B |
   
   **branch**
   | Metric | Value |
   |--------|-------|
   | Wall time | 35.0s |
   | Peak memory | 371.3 MiB |
   | Avg memory | 22.6 MiB |
   | CPU user | 30.9s |
   | CPU sys | 0.1s |
   | Peak spill | 0 B |
   
   
   </details>
   
   </details>
   
   </details>
   
   ---
   [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner
   
   <!-- benchmark-request:5971562060:finish:ecb153b6be4180f6594c75c1776e49ed -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub) via github" <gi...@arrow.apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-6838371064

   @Jefffrey -- @emecii seems to be busy and can't enable the CI on his fork. Can you move this to MQ without the fork CI pass?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub) via github" <gi...@arrow.apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-6586834165

   @emecii do you have the bandwidth to make the update?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "sdf-jkl (via GitHub)" <gi...@apache.org>.
sdf-jkl commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5684264095

   Thanks @emecii. The PR looks good directionally, but I want to be more thorough with performance and memory footprint of Variant.
   
   I will file an EPIC for tracking/filing Variant benchmarks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "Jefffrey (via GitHub) via github" <gi...@arrow.apache.org>.
Jefffrey commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-6840022777

   > @Jefffrey -- @emecii seems to be busy and can't enable the CI on his fork. Can you move this to MQ without the fork CI pass?
   
   no dont think im able to; i think i have the same level of github perms as you, only infra has admin


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(variant): preserve nulls for missing shredded list indexes [arrow-rs]

Posted by "emecii (via GitHub)" <gi...@apache.org>.
emecii commented on PR #11052:
URL: https://github.com/apache/arrow-rs/pull/11052#issuecomment-5970930802

   Merged main (`6d44c7c5`) in `64240f600c2aa2e911b2a5e0f7c08d211d67566d`, including all three list-index benchmark cases from #11193. The correctness patch is unchanged. On Rust 1.99.0, all 370 crate tests, 15 doc tests, three benchmark smoke cases, strict Clippy, and formatting passed. This enables benchmarking here; the earlier ~24% regression remains unresolved. OpenAI Codex performed the merge and validation and drafted this reply.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org