-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for building FixedSizeListBuilder in struct_builder's mak… #6595
Conversation
Please feel free to change anything required to merge this in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a test please
@@ -253,6 +253,13 @@ pub fn make_builder(datatype: &DataType, capacity: usize) -> Box<dyn ArrayBuilde | |||
let builder = make_builder(field.data_type(), capacity); | |||
Box::new(LargeListBuilder::with_capacity(builder, capacity).with_field(field.clone())) | |||
} | |||
DataType::FixedSizeList(field, size) => { | |||
let builder = make_builder(field.data_type(), capacity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be capacity*size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm are you sure, @tustvold I followed the pattern for the above Listbuilder, seems like either that's wrong too or this is right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ListBuilder doesn't have a fixed size
Sounds good, I was following the pattern in the rest of the code, it didn't seem like there were tests for every builder type. |
@tustvold made your suggested changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me -- thank you @kszlim
let size: usize = size.try_into().unwrap(); | ||
capacity * size | ||
}; | ||
let builder = make_builder(field.data_type(), values_builder_capacity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…e_builders
Which issue does this PR close?
Closes #6594 .
Rationale for this change
Makees
make_builders
more flexible/usefulWhat changes are included in this PR?
Adds support for FixedSizeList builders in make_builders
Are there any user-facing changes?
No API changes, but users will be able to successfully construct FixedSizeList builders.