Dandandan commented on code in PR #7517:
URL: https://github.com/apache/arrow-rs/pull/7517#discussion_r2096389572
##########
arrow-select/src/concat.rs:
##########
@@ -231,6 +231,45 @@ fn concat_bytes<T: ByteArrayType>(arrays: &[&dyn Array])
-> Result<ArrayRef, Arr
Ok(Arc::new(builder.finish()))
}
+fn concat_structs(arrays: &[&dyn Array], fields: &Fields) -> Result<ArrayRef,
ArrowError> {
+ let mut len = 0;
+ let mut has_nulls = false;
+ let structs = arrays
+ .iter()
+ .map(|a| {
+ len += a.len();
+ has_nulls |= a.null_count() > 0;
+ a.as_struct()
+ })
+ .collect::<Vec<_>>();
Review Comment:
Collecting `a.as_struct()` here into vec is not strictly needed I think?
We can use `arrays.iter()` in the later loops?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]