killme2008 commented on code in PR #27160:
URL: https://github.com/apache/datafusion/pull/27160#discussion_r4509584677
##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -385,6 +385,24 @@ fn filter_record_batch(
}
}
+fn take_case_rows<'a>(
+ batch: &'a RecordBatch,
+ indices: &dyn Array,
+) -> std::result::Result<Cow<'a, RecordBatch>, ArrowError> {
+ // These indices are an ordered subset of the original batch's rows.
+ if indices.len() == batch.num_rows() {
+ return Ok(Cow::Borrowed(batch));
+ }
+ let columns = arrow::compute::take_arrays(batch.columns(), indices, None)?;
+ Ok(Cow::Owned(RecordBatch::try_new_with_options(
+ batch.schema(),
+ columns,
+ &RecordBatchOptions::new()
+ .with_match_field_names(false)
Review Comment:
No in-tree producer builds such batches, so I dropped the option and
switched back to `take_record_batch` in
https://github.com/apache/datafusion/pull/27160/commits/0e1e39466aef7a7e6b9e4502586ca87e69c69adc
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]