Skip to content

minor(test): cover partially ordered aggregate spilling - #23947

Open
buraksenn wants to merge 1 commit into
apache:mainfrom
buraksenn:test-paritally-ordered-aggregate-spill
Open

minor(test): cover partially ordered aggregate spilling#23947
buraksenn wants to merge 1 commit into
apache:mainfrom
buraksenn:test-paritally-ordered-aggregate-spill

Conversation

@buraksenn

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

GroupedHashAggregateStream supports spilling for partially sorted group input, but existing aggregate spill tests only cover unordered (GroupOrdering::None) input. The GroupOrdering::Partial + OutOfMemoryMode::Spill path, including spilling sorted intermediate state and merging it back, does not have direct coverage.

What changes are included in this PR?

added test coverage for the case above

Are these changes tested?

test only change and it can be tested via:

    cargo test -p datafusion-physical-plan partially_sorted_single_aggregate_spills_and_matches

Are there any user-facing changes?

no test only change

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Jul 28, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.64789% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.69%. Comparing base (994fc81) to head (d7a29d9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/physical-plan/src/aggregates/mod.rs 74.64% 3 Missing and 15 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23947      +/-   ##
==========================================
- Coverage   80.69%   80.69%   -0.01%     
==========================================
  Files        1095     1095              
  Lines      372626   372697      +71     
  Branches   372626   372697      +71     
==========================================
+ Hits       300700   300735      +35     
- Misses      53978    53993      +15     
- Partials    17948    17969      +21     

☔ 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.

@2010YOUY01 2010YOUY01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

This suggestion is totally optional, it would be great to move it to sqllogictest, due to 1. the test can be stronger as it exercises the behavior end-to-end 2. easier to maintain (I found rust tests regularly need updates during refactors, and they're harder to review)

To do that, sqllogictest provides Rust hooks to setup tables with orders, and we can use explain/explain analyzes to assert if the ordered path is triggered, and if spill happens.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants