Skip to content

fix(array): reject unsupported type IDs#925

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/array-type-dispatch-bounds
Jul 12, 2026
Merged

fix(array): reject unsupported type IDs#925
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/array-type-dispatch-bounds

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

MakeFromData masked datatype IDs to six bits before dispatching to array constructors. Unsupported IDs could therefore alias valid constructors, silently producing the wrong concrete array type.

This validates the ID bounds and constructor entry before dispatching, while preserving the documented invalid-data-type panic. Regression coverage now includes IDs -1, 63, 64, 65, 127, and a large positive ID.

Tests:

  • go test ./arrow/array -run TestMakeFromData
  • go test ./arrow/array
  • go test ./arrow/... -run '^$'

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 11, 2026 07:44

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — replaces the &0x3f mask in MakeFromData with an explicit bounds + nil-constructor check, fixing the aliasing where type IDs >= 64 mapped onto valid constructors. CI green. Thanks @fallintoplace!

@zeroshade zeroshade merged commit 182bb17 into apache:main Jul 12, 2026
26 of 27 checks passed
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.

2 participants