Skip to content

fix: aggregate dynamic filtering with unsupported expressions - #24817

Open
lyne7-sc wants to merge 2 commits into
apache:mainfrom
lyne7-sc:fix/aggregate-dynamic-filter-unsupported-expression
Open

fix: aggregate dynamic filtering with unsupported expressions#24817
lyne7-sc wants to merge 2 commits into
apache:mainfrom
lyne7-sc:fix/aggregate-dynamic-filter-unsupported-expression

Conversation

@lyne7-sc

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Aggregate dynamic filtering currently ignores unsupported expressions while still generating a shared scan predicate from supported aggregates. This can prune rows required by the unsupported aggregate and produce incorrect results.

What changes are included in this PR?

  • Disable aggregate dynamic filtering when any aggregate expression is unsupported.
  • Document that aggregate dynamic filtering requires every aggregate expression to be supported.
  • Update the existing sqllogictest to verify that no dynamic filter is produced for mixed supported and unsupported expressions.

What is the testing strategy for this PR?

Yes. Updated the existing sqllogictest case in push_down_filter_regression.slt.

Are there any user-facing changes?

Yes. This fixes potentially incorrect query results. No API changes.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) physical-plan Changes to the physical-plan crate labels Aug 31, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.53%. Comparing base (4b8ad88) to head (67ea4ee).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #24817    +/-   ##
========================================
  Coverage   81.53%   81.53%            
========================================
  Files        1123     1123            
  Lines      406042   406284   +242     
  Branches   406042   406284   +242     
========================================
+ Hits       331059   331257   +198     
- Misses      55621    55660    +39     
- Partials    19362    19367     +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aggregate dynamic filter can prune rows required by unsupported expressions

2 participants