Skip to content

fix(arrow): return owned field index slices - #1159

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/field-indices-owned-slices
Draft

fix(arrow): return owned field index slices#1159
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/field-indices-owned-slices

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Rationale for this change

Schema.FieldIndices and StructType.FieldIndices return slices backed by internal index maps. Mutating a returned slice can corrupt later field lookups.

What changes are included in this PR?

Return cloned index slices from both methods. Schema.HasField reads the internal map directly so the ownership fix does not add an allocation there.

Are these changes tested?

Yes. Regression tests mutate returned slices and verify that Schema and StructType keep their original indices. The full arrow package suite passes.

Are there any user-facing changes?

Callers now receive slices they can safely modify.

@fallintoplace
fallintoplace marked this pull request as ready for review August 9, 2026 22:51
@fallintoplace
fallintoplace marked this pull request as draft August 9, 2026 22:54
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