Skip to content

feat: add ArrayData::new_default and change ArrayData::new_null for Struct and FixedSizeList to not have nulls in the children#9988

Open
rluvaton wants to merge 4 commits into
apache:mainfrom
rluvaton:add-new-default-function-to-array
Open

feat: add ArrayData::new_default and change ArrayData::new_null for Struct and FixedSizeList to not have nulls in the children#9988
rluvaton wants to merge 4 commits into
apache:mainfrom
rluvaton:add-new-default-function-to-array

Conversation

@rluvaton
Copy link
Copy Markdown
Member

@rluvaton rluvaton commented May 17, 2026

Which issue does this PR close?

Relates to:

Rationale for this change

ArrayData::new_null when called for Struct or FixedSizeList data type will create nulls for the children as well
even when the children are marked as non nullable.

while nothing in the spec forbid it, it is allowed but not very ideal, so trying to reduce the chances that this is happening.

What changes are included in this PR?

Created new ArrayData::new_default function that create array data with specific length with default values, and updated Struct data type and FixedSizeList in ArrayData::new_null to call it for its fields so we wont create StructArray and FixedSizeListArray with null children for non nullable fields

Are these changes tested?

Yes

Are there any user-facing changes?

new function and maybe change of behavior for new_null if it was dependent upon

@github-actions github-actions Bot added the arrow Changes to the arrow crate label May 17, 2026
@rluvaton rluvaton changed the title feat: add ArrayData::new_default feat: add ArrayData::new_default and change ArrayData::new_null for Struct and FixedSizeList to not have nulls in the children May 17, 2026
@rluvaton rluvaton marked this pull request as ready for review May 17, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant