Skip to content

Comments

Add constructors for FixedSize array types (#3879)#4263

Merged
tustvold merged 2 commits intoapache:masterfrom
tustvold:fixed-size-constructors
May 25, 2023
Merged

Add constructors for FixedSize array types (#3879)#4263
tustvold merged 2 commits intoapache:masterfrom
tustvold:fixed-size-constructors

Conversation

@tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #3879

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label May 23, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

👨‍🍳 👌 -- looks like a really nice improvement to me

/// * `!field.is_nullable() && !nulls.expand(size).contains(values.nulls())`
pub fn try_new(
field: FieldRef,
size: i32,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think naming this parameter value_length to align with the field name would make it easier to understand

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given it is a FixedSizeArray and not a FixedValueLengthArray I'm personally inclined to stick with size, but will sleep on it

}
let mask = buffer.into();
self.validate_non_nullable(Some(&mask), 0, child)?;
let expanded = nulls.expand(element_len);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a nice cleanup

@tustvold tustvold merged commit cb5d458 into apache:master May 25, 2023
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.

Array Destructuring APIs

2 participants