Skip to content

fix(array): honor struct offsets in constructors and validity masks#922

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/struct-array-offset-validity
Open

fix(array): honor struct offsets in constructors and validity masks#922
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/struct-array-offset-validity

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Struct convenience construction could retain the full child length after applying a non-zero offset, causing child slicing to run past the end. Parent validity masking also addressed logical row positions instead of the child bitmap's physical offset.

This change validates struct offsets, uses length-offset for the constructed array, applies the existing null-bitmap validation to the names-based constructor, and masks child validity at physical bitmap positions. It also sizes replacement bitmaps for leading child offsets.

Tests:

  • go test ./arrow/array -run 'Test(NewStructArrayWithNullsValidatesOffset|StructStringMasksParentValidityAtPhysicalOffset|StructArrayStringerMasksRequiredChildWithoutNullBitmap)'
  • go test ./arrow/array

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 11, 2026 07:33
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