Skip to content

fix(arrow-data): avoid unnecessary FixedSizeList null expansion - #12121

Open
WaterWhisperer wants to merge 2 commits into
apache:mainfrom
WaterWhisperer:fix-11855-fixed-size-list-null-validation
Open

WaterWhisperer wants to merge 2 commits into
apache:mainfrom
WaterWhisperer:fix-11855-fixed-size-list-null-validation

Conversation

@WaterWhisperer

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

FixedSizeList null validation can allocate a large parent bitmap even when the visible child range contains no nulls.

What changes are included in this PR?

Skip expansion when the visible child range has no nulls. Use try_expand to return MemoryError if a required expansion fails.

Are these changes tested?

Yes. Existing tests cover null masking and sliced child ranges. The full workspace test suite and Clippy passed locally.

A local allocation probe using valid empty Struct children confirmed zero allocation when expansion is unnecessary, and MemoryError instead of a panic when a required bitmap allocation is rejected. The probe is not included in this PR.

Are there any significant user-facing changes?

No.

AI usage disclosure

OpenAI Codex assisted with the implementation and local validation. I reviewed and verified the changes.

@github-actions github-actions Bot added arrow-core Core crates related to representing arrow data bug labels Nov 8, 2026

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we add a regression test for this behavior

@WaterWhisperer

Copy link
Copy Markdown
Contributor Author

can we add a regression test for this behavior

sure

@@ -0,0 +1,101 @@
// SPDX-License-Identifier: Apache-2.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this shouldn't be in its own file, add it to the test section of arrow-data/src/data.rs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data: validating fixedsizelist nulls doesnt need to always expand

2 participants