You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kszlim (via GitHub)" <gi...@apache.org> on 2024/10/20 10:11:51 UTC
[PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
kszlim opened a new pull request, #6595:
URL: https://github.com/apache/arrow-rs/pull/6595
…e_builders
# Which issue does this PR close?
Closes #6594 .
# Rationale for this change
Makees `make_builders` more flexible/useful
# What 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#discussion_r1809241062
##########
arrow-array/src/builder/struct_builder.rs:
##########
@@ -253,6 +253,18 @@ 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 size = *size;
+ let values_builder_capacity = {
+ let size: usize = size.try_into().unwrap();
+ capacity * size
+ };
+ let builder = make_builder(field.data_type(), values_builder_capacity);
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "kszlim (via GitHub)" <gi...@apache.org>.
kszlim commented on PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#issuecomment-2424826319
Please feel free to change anything required to merge this in
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#discussion_r1807958045
##########
arrow-array/src/builder/struct_builder.rs:
##########
@@ -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);
Review Comment:
I think this should be `capacity*size`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "kszlim (via GitHub)" <gi...@apache.org>.
kszlim commented on PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#issuecomment-2427329585
@tustvold made your suggested changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "kszlim (via GitHub)" <gi...@apache.org>.
kszlim commented on code in PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#discussion_r1807963463
##########
arrow-array/src/builder/struct_builder.rs:
##########
@@ -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);
Review Comment:
Will do
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "kszlim (via GitHub)" <gi...@apache.org>.
kszlim commented on PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#issuecomment-2425276639
> Can we get a test please
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "kszlim (via GitHub)" <gi...@apache.org>.
kszlim commented on code in PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#discussion_r1807967283
##########
arrow-array/src/builder/struct_builder.rs:
##########
@@ -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);
Review Comment:
Hmm are you sure, @tustvold I followed the pattern for the above Listbuilder, seems like either that's wrong too or this is right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add support for building FixedSizeListBuilder in struct_builder's mak… [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #6595:
URL: https://github.com/apache/arrow-rs/pull/6595#discussion_r1808253002
##########
arrow-array/src/builder/struct_builder.rs:
##########
@@ -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);
Review Comment:
ListBuilder doesn't have a fixed size
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org