Skip to content

fix: preserve aggregate filter pushdown order - #5

Merged
evenyag merged 1 commit into
GreptimeTeam:greptimedb-53.1.0-function-signature-exec-errorfrom
discord9:fix/rdf-aggregate-filter-pushdown
Jun 9, 2026
Merged

fix: preserve aggregate filter pushdown order#5
evenyag merged 1 commit into
GreptimeTeam:greptimedb-53.1.0-function-signature-exec-errorfrom
discord9:fix/rdf-aggregate-filter-pushdown

Conversation

@discord9

@discord9 discord9 commented Jun 9, 2026

Copy link
Copy Markdown

What

Preserve parent filter ordering in AggregateExec::gather_filters_for_pushdown.

FilterPushdown maps child pushdown results back to parent filters by position. AggregateExec previously split filters into safe and unsafe buckets, which reordered mixed filters and could report an aggregate-output filter as pushed down.

Why

Filters on grouping keys are safe to push below AggregateExec, while filters on aggregate outputs must remain above it. When both appear together, preserving the original parent filter order is required for correct result mapping.

Tests

  • cargo fmt --check
  • cargo test -p datafusion --test core_integration physical_optimizer::filter_pushdown::test_pushdown_through_aggregates_preserves_parent_filter_order
  • cargo test -p datafusion --test core_integration physical_optimizer::filter_pushdown::test_pushdown_through_aggregates

Also validated from GreptimeDB with local DataFusion path patch:

  • distributed:rdf_having_filter_repro$
  • distributed:inner_join_advanced$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants