Dandandan commented on code in PR #7614: URL: https://github.com/apache/arrow-rs/pull/7614#discussion_r2133582946
########## arrow-select/src/coalesce.rs: ########## @@ -242,14 +242,14 @@ impl BatchCoalescer { /// However, after a while (e.g., after `FilterExec` or `HashJoinExec`) the /// `StringViewArray` may only refer to a small portion of the buffer, /// significantly increasing memory usage. -fn gc_string_view_batch(batch: &RecordBatch) -> RecordBatch { - let new_columns: Vec<ArrayRef> = batch - .columns() - .iter() +fn gc_string_view_batch(batch: RecordBatch) -> RecordBatch { + let (schema, columns, num_rows) = batch.into_parts(); + let new_columns: Vec<ArrayRef> = columns Review Comment: AFAIK there is a Rust compiler optimization that will reuse a `Vec` allocation if using into_iter / collect (on owned Vec) 🤔 -- 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