Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e210bf4
GH-55292: [C++][Dataset] Prune row groups for large is_in value sets …
rok Oct 27, 2026
0b1410a
GH-55292: [C++] Sort primitive is_in value sets directly instead of v…
rok Oct 27, 2026
0098571
GH-55292: [C++] Handle nullable ranges and legacy null options in is_…
rok Oct 29, 2026
79750a7
GH-55292: [C++] Restate guarantees through non-injective casts and pr…
rok Oct 29, 2026
9cbe6ae
GH-55292: [C++] Sort is_in value sets lazily and prune EMIT_NULL and …
rok Nov 3, 2026
a741870
GH-55292: [C++] Reuse sort_indices and search_sorted for is_in prunin…
rok Nov 3, 2026
625cf4e
GH-55292: [C++] Bound value sets longer than 2^17 by their min and ma…
rok Nov 3, 2026
e3b1556
GH-55292: [C++] Build the int32 value set in the Parquet test with a …
rok Nov 3, 2026
1078fe7
GH-55292: [C++] Only convert guarantee bounds between types ordered a…
rok Nov 10, 2026
3d76c38
GH-55292: [C++] Let the is_in kernel evaluate itself over a range and…
rok Nov 10, 2026
7556951
GH-55292: [C++] Drop guards no test or caller depends on and test the…
rok Nov 10, 2026
683b23e
GH-55292: [C++] Round guarantee bounds which a safe cast rounds inste…
rok Nov 10, 2026
cadc4fc
GH-55292: [C++] Compare small is_in value sets in the argument's type…
rok Nov 16, 2026
7101ce6
GH-55292: [C++] Leave the handling of casts as it is and only use nul…
rok Nov 17, 2026
300d438
GH-55292: [C++] Trim redundant cases from the is_in pruning tests
rok Nov 17, 2026
249c12d
GH-55292: [C++] Remove test cases which do not depend on the logic added
rok Nov 17, 2026
c7f7dbc
GH-55292: [C++] Benchmark simplifying a large is_in against a range g…
rok Nov 17, 2026
2c74320
GH-55292: [C++] Avoid folding float comparisons against nullable Parq…
rok Nov 18, 2026
8b6b0af
GH-55292: [C++] Repeat the range simplification pass while it changes…
rok Nov 18, 2026
bdc9689
GH-55292: [C++] Bound large chunked is_in value sets without concaten…
rok Nov 18, 2026
097d1b9
GH-55292: [C++] Keep main's simplification loop and evaluate large is…
rok Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cpp/src/arrow/acero/expression_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <thread>

#include "arrow/acero/test_util_internal.h"
#include "arrow/array/builder_primitive.h"
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/cast.h"
#include "arrow/compute/expression.h"
#include "arrow/dataset/partition.h"
Expand Down Expand Up @@ -151,6 +153,30 @@ auto guarantee = and_(equal(field_ref("a"), literal(int64_t(99))),
auto guarantee_dictionary = and_(equal(field_ref("a"), literal(ninety_nine_dict)),
equal(field_ref("b"), literal(ninety_nine_dict)));

// An is_in filter whose value set is too large to be narrowed for each guarantee:
// 100000 multiples of 1000.
Expression MakeLargeIsInFilter() {
Int64Builder builder;
for (int64_t i = 0; i < 100000; ++i) {
ABORT_NOT_OK(builder.Append(i * 1000));
}
ASSIGN_OR_ABORT(auto value_set, builder.Finish());
return call("is_in", {field_ref("a")}, compute::SetLookupOptions{value_set});
}
auto filter_large_is_in = MakeLargeIsInFilter();

// The guarantee which the statistics of a Parquet row group give: its smallest and
// largest value, here between two values of the set or including one.
auto guarantee_range_negative =
and_(greater_equal(field_ref("a"), literal(int64_t(5001))),
less_equal(field_ref("a"), literal(int64_t(5999))));
auto guarantee_range_positive =
and_(greater_equal(field_ref("a"), literal(int64_t(5000))),
less_equal(field_ref("a"), literal(int64_t(5999))));
// ... and of a row group which may contain nulls.
auto guarantee_nullable_range_negative =
or_(guarantee_range_negative, is_null(field_ref("a")));

auto complex_expression =
and_(less(field_ref("x"), literal(20)), greater(field_ref("x"), literal(0)));
auto complex_integer_expression =
Expand All @@ -171,6 +197,12 @@ BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee,
guarantee_dictionary);
BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee, negative_filter_cast_guarantee_dictionary,
filter_cast_negative, guarantee_dictionary);
BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee,
negative_filter_large_is_in_guarantee_range, filter_large_is_in,
guarantee_range_negative);
BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee,
negative_filter_large_is_in_guarantee_nullable_range,
filter_large_is_in, guarantee_nullable_range_negative);
// Positive queries (partition expressions that pass the filter)
BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee, positive_filter_simple_guarantee_simple,
filter_simple_positive, guarantee);
Expand All @@ -181,6 +213,9 @@ BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee,
guarantee_dictionary);
BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee, positive_filter_cast_guarantee_dictionary,
filter_cast_positive, guarantee_dictionary);
BENCHMARK_CAPTURE(SimplifyFilterWithGuarantee,
positive_filter_large_is_in_guarantee_range, filter_large_is_in,
guarantee_range_positive);

BENCHMARK_CAPTURE(BindAndEvaluate, simple_array, field_ref("int_arr"));
BENCHMARK_CAPTURE(BindAndEvaluate, simple_scalar, field_ref("int_scalar"));
Expand Down
Loading
Loading