Skip to content

fix: report correct number of items left in the iterator for IncrementalSortIterator - #25107

Open
rluvaton wants to merge 1 commit into
apache:mainfrom
rluvaton:fix-len-reporting-on-incremental-sort-iterator
Open

fix: report correct number of items left in the iterator for IncrementalSortIterator#25107
rluvaton wants to merge 1 commit into
apache:mainfrom
rluvaton:fix-len-reporting-on-incremental-sort-iterator

Conversation

@rluvaton

@rluvaton rluvaton commented Sep 9, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A

Rationale for this change

size_hint for IncrementalSortIterator returns the initial number of items rather than how many items left in the iterator

What changes are included in this PR?

update size hint to consider the number of elements already produced, impl ExactSizeIterator and added test

What is the testing strategy for this PR?

unit test

Are there any user-facing changes?

no

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Sep 9, 2026

@EmilyMatt EmilyMatt 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, my bad 😐

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.80%. Comparing base (a5c809f) to head (5e96426).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/physical-plan/src/sorts/stream.rs 86.66% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25107      +/-   ##
==========================================
+ Coverage   81.74%   81.80%   +0.05%     
==========================================
  Files        1128     1130       +2     
  Lines      416644   417793    +1149     
  Branches   416644   417793    +1149     
==========================================
+ Hits       340592   341777    +1185     
+ Misses      55995    55882     -113     
- Partials    20057    20134      +77     

☔ 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants