Dandandan commented on code in PR #7517: URL: https://github.com/apache/arrow-rs/pull/7517#discussion_r2102703599
########## 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: I meant we strictly don't have to call `a.as_struct()` here and collect into a Vec, but can do `s.as_struct().column(i)` later maybe (it will slightly increase the calls to `as_struct` so not sure if that has any perf impact or not - probably effect won't be very large either way) -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org