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:
   Arrow accepts this batch through 
`try_new_with_options(...with_match_field_names(false))`. The option permits 
different nested field names. The checked constructor still validates 
compatible types and row counts.
   
    The filter path preserves this input. Keeping the option in the take path 
avoids rejecting a batch that worked before this change.
   
   



-- 
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]

Reply via email to