odysa commented on code in PR #7922: URL: https://github.com/apache/arrow-rs/pull/7922#discussion_r2203535208
########## parquet-variant/src/builder.rs: ########## @@ -402,6 +402,11 @@ impl<S: AsRef<str>> FromIterator<S> for MetadataBuilder { impl<S: AsRef<str>> Extend<S> for MetadataBuilder { fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T) { + let iter = iter.into_iter(); + let (min, max) = iter.size_hint(); + + self.field_names.reserve(max.unwrap_or(min)); + for field_name in iter { self.upsert_field_name(field_name.as_ref()); Review Comment: Can we directly extend here? like ```rust self.field_names.extend(....) ``` The challenge here is how to maintain the `self.is_sorted` https://github.com/apache/arrow-rs/blob/daf31bec63836f1fe7bb0a9fa1a98467546374fc/parquet-variant/src/builder.rs#L310-L324 -- 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