Skip to content

Commit c2f4954

Browse files
committed
Revert "Revert "Dynamic filter pushdown for TopK sorts (apache#15770)""
This reverts commit 6e83cf4.
1 parent a5d646b commit c2f4954

File tree

21 files changed

+951
-59
lines changed

21 files changed

+951
-59
lines changed

datafusion/common/src/config.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,13 @@ config_namespace! {
681681
/// during aggregations, if possible
682682
pub enable_topk_aggregation: bool, default = true
683683

684+
/// When set to true attempts to push down dynamic filters generated by operators into the file scan phase.
685+
/// For example, for a query such as `SELECT * FROM t ORDER BY timestamp DESC LIMIT 10`, the optimizer
686+
/// will attempt to push down the current top 10 timestamps that the TopK operator references into the file scans.
687+
/// This means that if we already have 10 timestamps in the year 2025
688+
/// any files that only have timestamps in the year 2024 can be skipped / pruned at various stages in the scan.
689+
pub enable_dynamic_filter_pushdown: bool, default = true
690+
684691
/// When set to true, the optimizer will insert filters before a join between
685692
/// a nullable and non-nullable column to filter out nulls on the nullable side. This
686693
/// filter can add additional overhead when the file format does not fully support

datafusion/core/tests/fuzz_cases/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ mod join_fuzz;
2121
mod merge_fuzz;
2222
mod sort_fuzz;
2323
mod sort_query_fuzz;
24+
mod topk_filter_pushdown;
2425

2526
mod aggregation_fuzzer;
2627
mod equivalence;

0 commit comments

Comments
 (0)