jorisvandenbossche commented on code in PR #40971:
URL: https://github.com/apache/arrow/pull/40971#discussion_r1561203648


##########
cpp/src/arrow/compute/kernels/vector_selection_filter_internal.cc:
##########
@@ -1039,10 +1039,17 @@ class FilterMetaFunction : public MetaFunction {
 
     if (args[0].kind() == Datum::RECORD_BATCH) {
       auto values_batch = args[0].record_batch();
-      ARROW_ASSIGN_OR_RAISE(
-          std::shared_ptr<RecordBatch> out_batch,
-          FilterRecordBatch(*args[0].record_batch(), args[1], options, ctx));
-      return Datum(out_batch);
+      if (args[1].kind() == Datum::ARRAY) {
+        ARROW_ASSIGN_OR_RAISE(std::shared_ptr<RecordBatch> out_batch,
+                              FilterRecordBatch(*values_batch, args[1], 
options, ctx));
+        return Datum(out_batch);
+      } else {

Review Comment:
   `FilterRecordBatch` is only used for `FilterMetaFunction::ExecuteImpl`, so 
it's not that expanding the capabilities is useful in general for other use 
cases. So just for the kernel exec, to me it seems like unnecessary duplication 
to expand `FilterRecordBatch` to also rechunk the input, given that the 
conversion of RecordBatch to Table is a cheap zero-copy one.



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

Reply via email to