jorisvandenbossche commented on code in PR #40971:
URL: https://github.com/apache/arrow/pull/40971#discussion_r1561206443
##########
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:
Additionally, this keeps the return value of filtering a RecordBatch with
Array as RecordBatch, and not Table, which it would be it `FilterRecordBatch`
gets generalized (unless we add logic to convert back the Table to RecordBatch
in that case)
--
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]