Skip to content

Commit

Permalink
Instantiate VisitFilterOutputFragmentsFunctor template argument at th…
Browse files Browse the repository at this point in the history
…e callsite

This hides the FilterRunEndType from
VisitREExAnyFilterCombinedOutputRuns making it usable for REExPlain
filtering.
  • Loading branch information
felipecrv committed May 9, 2023
1 parent d55527b commit 08d15fa
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions cpp/src/arrow/compute/kernels/vector_run_end_selection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ValuesRunEndType, typename ValuesValueType, typename FilterRunEndType,
template <typename VRET, typename VVT>
typename VisitFilterOutputFragmentsFunctor,
typename EmitRun>
template <typename ValuesRunEndType, typename ValuesValueType,
class VisitFilterOutputFragmentsFunctor, typename EmitRun>
Status VisitREExAnyFilterCombinedOutputRuns(
MemoryPool* pool, const ArraySpan& values, const ArraySpan& filter,
FilterOptions::NullSelectionBehavior null_selection, EmitRun emit_run) {
Expand All @@ -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<ValuesRunEndType, FilterRunEndType>{}(
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,
Expand Down Expand Up @@ -545,14 +543,13 @@ class REExREEFilterExecImpl final : public REEFilterExec {
return CountREEFilterEmits<FilterRunEndType>(filter_, null_selection_) > 0 ? 1 : 0;
} else {
int64_t num_output_runs = 0;
auto status =
VisitREExAnyFilterCombinedOutputRuns<ValuesRunEndType, ValuesValueType,
FilterRunEndType,
VisitREExREEFilterOutputFragments>(
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<ValuesRunEndType, FilterRunEndType>>(
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;
}
Expand Down Expand Up @@ -580,9 +577,9 @@ class REExREEFilterExecImpl final : public REEFilterExec {
int64_t logical_length = 0;
int64_t write_offset = 0;
ValueRepr value;
auto status = VisitREExAnyFilterCombinedOutputRuns<ValuesRunEndType, ValuesValueType,
FilterRunEndType,
VisitREExREEFilterOutputFragments>(
auto status = VisitREExAnyFilterCombinedOutputRuns<
ValuesRunEndType, ValuesValueType,
VisitREExREEFilterOutputFragments<ValuesRunEndType, FilterRunEndType>>(
pool_, values_, filter_, null_selection_,
[&](int64_t i, int64_t run_length, bool valid) {
logical_length += run_length;
Expand Down

0 comments on commit 08d15fa

Please sign in to comment.