Skip to content

docs: Document expectations of PartialReduce aggregate mode - #24640

Merged
gabotechs merged 1 commit into
apache:mainfrom
alamb:partial-reduce-mode-docs
Aug 26, 2026
Merged

docs: Document expectations of PartialReduce aggregate mode#24640
gabotechs merged 1 commit into
apache:mainfrom
alamb:partial-reduce-mode-docs

Conversation

@alamb

@alamb alamb commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

When AggregateMode::PartialReduce was added in #20019 from @njsmith, I believe the intention was that it is purely a best-effort optimization: it reduces the volume of intermediate aggregate state (for example, before sending it over the network in a distributed plan), but it is not required to be fully reduced, and consumers must merge it regardless.

However, this contract was never explicitly written down, which came up while I was reviewing #24486 from @2010YOUY01

What changes are included in this PR?

Documentation only (no code changes): add a "Best-Effort Reduction" section to
the AggregateMode::PartialReduce variant docs stating the output contract.

Are these changes tested?

Covered by CI docs checks (cargo doc passes with -D warnings).

Are there any user-facing changes?

Documentation only.

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Aug 24, 2026
@alamb alamb added the documentation Improvements or additions to documentation label Aug 24, 2026
@alamb
alamb marked this pull request as ready for review August 24, 2026 21:37
/// <https://github.com/datafusion-contrib/datafusion-distributed/issues/360>
/// for details.
///
/// # Best-Effort Reduction

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@njsmith and @gabotechs does this match your understanding of what PartialReduce is supposed to do?

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.

It does yeah

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.43%. Comparing base (26b40dd) to head (f541634).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24640      +/-   ##
==========================================
- Coverage   81.43%   81.43%   -0.01%     
==========================================
  Files        1118     1118              
  Lines      399414   399414              
  Branches   399414   399414              
==========================================
- Hits       325278   325275       -3     
  Misses      55145    55145              
- Partials    18991    18994       +3     

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

@gabotechs gabotechs 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.

This makes sense, thanks @alamb! would love to hear if @njsmith had other non-best-effort use case in mind.

@gabotechs
gabotechs added this pull request to the merge queue Aug 26, 2026
Merged via the queue into apache:main with commit 9a3d353 Aug 26, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants