HawaiianSpork commented on code in PR #9710:
URL: https://github.com/apache/arrow-rs/pull/9710#discussion_r3464032000
##########
arrow-data/src/transform/structure.rs:
##########
@@ -17,21 +17,45 @@
use super::{_MutableArrayData, Extend};
use crate::ArrayData;
+use arrow_schema::{ArrowError, DataType};
pub(super) fn build_extend(_: &ArrayData) -> Extend<'_> {
Box::new(
move |mutable: &mut _MutableArrayData, index: usize, start: usize,
len: usize| {
- mutable
- .child_data
- .iter_mut()
- .for_each(|child| child.extend(index, start, start + len))
+ // Collect field names before the mutable borrow of child_data.
+ let field_names = struct_field_names(&mutable.data_type);
Review Comment:
That is fair, I moved the allocation into the error handling so the
allocation should happen only when there is an error.
--
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]