diff --git a/cpp/src/arrow/compute/kernels/vector_run_end_selection.cc b/cpp/src/arrow/compute/kernels/vector_run_end_selection.cc index ae8d113694793..ebbb06b18bfeb 100644 --- a/cpp/src/arrow/compute/kernels/vector_run_end_selection.cc +++ b/cpp/src/arrow/compute/kernels/vector_run_end_selection.cc @@ -132,10 +132,8 @@ struct VisitREExREEFilterOutputFragments { /// run_value_i should not be used as nulls can be emitted from the filter when /// null_selection=EMIT_NULL. In that case, run_value_i wouldn't necessarily /// point to a NULL value in the values array. -template - typename VisitFilterOutputFragmentsFunctor, - typename EmitRun> +template Status VisitREExAnyFilterCombinedOutputRuns( MemoryPool* pool, const ArraySpan& values, const ArraySpan& filter, FilterOptions::NullSelectionBehavior null_selection, EmitRun emit_run) { @@ -158,7 +156,7 @@ Status VisitREExAnyFilterCombinedOutputRuns( // values[open_run_value_i] because null values from filters (combined with // FilterOptions::EMIT_NULL) can cause nulls to be emitted as well. int64_t open_run_value_i = -1; - auto status = VisitFilterOutputFragmentsFunctor{}( + auto status = VisitFilterOutputFragmentsFunctor{}( pool, values, filter, null_selection, [all_values_are_null, values_validity, &read_write, &open_run_length, &open_run_is_null, &open_run_value_i, @@ -545,14 +543,13 @@ class REExREEFilterExecImpl final : public REEFilterExec { return CountREEFilterEmits(filter_, null_selection_) > 0 ? 1 : 0; } else { int64_t num_output_runs = 0; - auto status = - VisitREExAnyFilterCombinedOutputRuns( - pool_, values_, filter_, null_selection_, - [&num_output_runs](int64_t, int64_t run_length, bool) { - num_output_runs += run_length > 0; - }); + auto status = VisitREExAnyFilterCombinedOutputRuns< + ValuesRunEndType, ValuesValueType, + VisitREExREEFilterOutputFragments>( + pool_, values_, filter_, null_selection_, + [&num_output_runs](int64_t, int64_t run_length, bool) { + num_output_runs += run_length > 0; + }); RETURN_NOT_OK(status); return num_output_runs; } @@ -580,9 +577,9 @@ class REExREEFilterExecImpl final : public REEFilterExec { int64_t logical_length = 0; int64_t write_offset = 0; ValueRepr value; - auto status = VisitREExAnyFilterCombinedOutputRuns( + auto status = VisitREExAnyFilterCombinedOutputRuns< + ValuesRunEndType, ValuesValueType, + VisitREExREEFilterOutputFragments>( pool_, values_, filter_, null_selection_, [&](int64_t i, int64_t run_length, bool valid) { logical_length += run_length;