Skip to content

Commit

Permalink
ARROW-8331: [C++] Fix filter_benchmark.cc compilation
Browse files Browse the repository at this point in the history
This issue exposes a blind spot in our CI -- we are not checking that our benchmarks compile. I think we should alter the CI to fix this -- I opened ARROW-8333.

Closes #6834 from wesm/ARROW-8331

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
  • Loading branch information
wesm committed Apr 3, 2020
1 parent cc3a26a commit 9c0a5ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions cpp/src/arrow/compute/kernels/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class ARROW_EXPORT FilterKernel : public BinaryKernel {
///
/// \param[in] value_type constructed FilterKernel will support filtering
/// values of this type
/// \param[in] options configures null_selection_behavior
/// \param[out] out created kernel
static Status Make(std::shared_ptr<DataType> value_type, FilterOptions options,
std::unique_ptr<FilterKernel>* out);
Expand Down
9 changes: 6 additions & 3 deletions cpp/src/arrow/compute/kernels/filter_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ static void FilterInt64(benchmark::State& state) {
auto filter = std::static_pointer_cast<BooleanArray>(
rand.Boolean(array_size, 0.75, args.null_proportion));

FilterOptions options;
FunctionContext ctx;
for (auto _ : state) {
Datum out;
ABORT_NOT_OK(Filter(&ctx, Datum(array), Datum(filter), &out));
ABORT_NOT_OK(Filter(&ctx, Datum(array), Datum(filter), options, &out));
benchmark::DoNotOptimize(out);
}
}
Expand All @@ -60,10 +61,11 @@ static void FilterFixedSizeList1Int64(benchmark::State& state) {
auto filter = std::static_pointer_cast<BooleanArray>(
rand.Boolean(array_size, 0.75, args.null_proportion));

FilterOptions options;
FunctionContext ctx;
for (auto _ : state) {
Datum out;
ABORT_NOT_OK(Filter(&ctx, Datum(array), Datum(filter), &out));
ABORT_NOT_OK(Filter(&ctx, Datum(array), Datum(filter), options, &out));
benchmark::DoNotOptimize(out);
}
}
Expand All @@ -84,10 +86,11 @@ static void FilterString(benchmark::State& state) {
auto filter = std::static_pointer_cast<BooleanArray>(
rand.Boolean(array_size, 0.75, args.null_proportion));

FilterOptions options;
FunctionContext ctx;
for (auto _ : state) {
Datum out;
ABORT_NOT_OK(Filter(&ctx, Datum(array), Datum(filter), &out));
ABORT_NOT_OK(Filter(&ctx, Datum(array), Datum(filter), options, &out));
benchmark::DoNotOptimize(out);
}
}
Expand Down

0 comments on commit 9c0a5ee

Please sign in to comment.