Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fe6bcf1
GH-55292: [C++][Dataset] Prune row groups for large is_in value sets …
rok Oct 27, 2026
2cc1d9f
GH-55292: [C++] Sort primitive is_in value sets directly instead of v…
rok Oct 27, 2026
eeb2def
GH-55292: [C++] Handle nullable ranges and legacy null options in is_…
rok Oct 29, 2026
48606b0
GH-55292: [C++] Restate guarantees through non-injective casts and pr…
rok Oct 29, 2026
5ddcc3c
GH-55292: [C++] Sort is_in value sets lazily and prune EMIT_NULL and …
rok Nov 3, 2026
c4ede51
GH-55292: [C++] Reuse sort_indices and search_sorted for is_in prunin…
rok Nov 3, 2026
3547720
GH-55292: [C++] Bound value sets longer than 2^17 by their min and ma…
rok Nov 3, 2026
ea5847b
GH-55292: [C++] Build the int32 value set in the Parquet test with a …
rok Nov 3, 2026
dc8d9f8
GH-55292: [C++] Only convert guarantee bounds between types ordered a…
rok Nov 10, 2026
1788b0d
GH-55292: [C++] Let the is_in kernel evaluate itself over a range and…
rok Nov 10, 2026
cedca30
GH-55292: [C++] Drop guards no test or caller depends on and test the…
rok Nov 10, 2026
114e00f
GH-55292: [C++] Round guarantee bounds which a safe cast rounds inste…
rok Nov 10, 2026
50a4e96
GH-55292: [C++] Compare small is_in value sets in the argument's type…
rok Nov 16, 2026
f1e3c7a
GH-55292: [C++] Leave the handling of casts as it is and only use nul…
rok Nov 17, 2026
fbb5f2f
GH-55292: [C++] Trim redundant cases from the is_in pruning tests
rok Nov 17, 2026
b6e207f
GH-55292: [C++] Remove test cases which do not depend on the logic added
rok Nov 17, 2026
15b36b1
GH-55292: [C++] Benchmark simplifying a large is_in against a range g…
rok Nov 17, 2026
ab84706
GH-55292: [C++] Avoid folding float comparisons against nullable Parq…
rok Nov 18, 2026
b5cd3d5
GH-55292: [C++] Repeat the range simplification pass while it changes…
rok Nov 18, 2026
7af1b8a
GH-55292: [C++] Bound large chunked is_in value sets without concaten…
rok Nov 18, 2026
bc8f824
GH-55292: [C++] Keep main's simplification loop and evaluate large is…
rok Nov 18, 2026
2495867
GH-55292: [C++] Apply nullable ranges and the large is_in pass after …
rok Nov 18, 2026
50f7e2d
GH-55292: [C++] Address review feedback on is_in range pruning
rok Dec 2, 2026
898e931
GH-55292: [C++] Trim PR #55293 in place for reviewability
rok Dec 2, 2026
6f14281
GH-55292: [C++] Fix formatting and clarify nullable-range ordering co…
rok Dec 3, 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