Skip to content

feat: remove extra Rows from ReusableRows#23802

Open
ariel-miculas wants to merge 1 commit into
apache:mainfrom
ariel-miculas:remove-extra-rows-in-reusable-rows
Open

feat: remove extra Rows from ReusableRows#23802
ariel-miculas wants to merge 1 commit into
apache:mainfrom
ariel-miculas:remove-extra-rows-in-reusable-rows

Conversation

@ariel-miculas

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

This change reduces the peak allocated memory by removing the unnecessary Rows from being cached.

It will only work after #23619 is merged, until then test_round_robin_tie_breaker_success will fail:

Error: Internal("Rows from RowCursorStream is still in use by consumer") test sorts::sort_preserving_merge::tests::test_round_robin_tie_breaker_success ... FAILED

The failure is triggered by prev_cursors from SortPreservingMergeStream keeping the previous Cursor alive for round robin tie breaking purposes. The optimization from #23619 only keeps the last Row, so there's no longer a need to keep two Rows cached in ReusableRows.

What changes are included in this PR?

Are these changes tested?

There's an existing test that currenly fails with this change and it will pass once #23619 is merged

Are there any user-facing changes?

No

Fixes: apache#23801

It will only work after apache#23619
is merged, until then test_round_robin_tie_breaker_success will fail:

Error: Internal("Rows from RowCursorStream is still in use by consumer")
test sorts::sort_preserving_merge::tests::test_round_robin_tie_breaker_success ... FAILED

The failure is triggered by prev_cursors from SortPreservingMergeStream
keeping the previous Cursor alive for round robin tie breaking purposes.
The optimization from apache#23619 only keeps the last Row, so there's no
longer a need to keep two Rows cached in ReusableRows.
@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Jul 22, 2026
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.

Remove the buffering of an extra Rows in ReusableRows

1 participant