Skip to content

Validate dense union offset lengths#875

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix-dense-union-offset-length
Open

Validate dense union offset lengths#875
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix-dense-union-offset-length

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What changed

NewDenseUnionFromArraysWithFieldCodes now rejects mismatched type ID and offset lengths before constructing dense union data.

Why

Dense unions use typeIDs.Len() as the logical length while borrowing the offsets buffer. If the offsets array is shorter, later access can panic or read invalid offset data; if it is longer, trailing offsets are silently ignored.

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

@fallintoplace fallintoplace requested a review from zeroshade as a code owner June 30, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant