You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "fallintoplace (via GitHub)" <gi...@apache.org> on 2026/06/30 23:00:44 UTC

[PR] Validate dense union slice offsets [arrow-go]

fallintoplace opened a new pull request, #877:
URL: https://github.com/apache/arrow-go/pull/877

   ### What changed
   
   NewDenseUnionFromArraysWithFieldCodes now rejects type ID and offset arrays whose ArrayData offsets differ.
   
   ### Why
   
   Dense unions store the type ID data offset as the union data offset, and ValueOffset uses that same offset to index the borrowed offsets buffer. If the offsets array is sliced differently from the type IDs array, the dense union can read the wrong physical offset entries.
   
   ### Validation
   
   - go test ./arrow/array -run 'TestUnions/TestMakeDenseUnions' -count=1
   - go test ./arrow/array -count=1
   - PARQUET_TEST_DATA=/Users/hoangvu/Code/OSS/arrow-go/parquet-testing/data ARROW_TEST_DATA=/Users/hoangvu/Code/OSS/arrow-go/arrow-testing/data go test ./... -count=1


-- 
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] Validate dense union slice offsets [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on PR #877:
URL: https://github.com/apache/arrow-go/pull/877#issuecomment-4857843687

   Rather than reject this, we should properly support it instead. There's no reason why we shouldn't allow constructing a dense union where the offsets and typeIDs are using different offsets. Rather than rejecting this, can we instead fix the physical offset handling to handle this scenario? 
   
   For reference, neither C++ nor rust reject this, but both exhibit this same bug. 


-- 
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