refactor(hash-aggr): Support spilling for single mode aggregation - #23965
Open
2010YOUY01 wants to merge 1 commit into
Open
refactor(hash-aggr): Support spilling for single mode aggregation#239652010YOUY01 wants to merge 1 commit into
2010YOUY01 wants to merge 1 commit into
Conversation
2010YOUY01
commented
Jul 29, 2026
| Field::new("b", DataType::Float64, false), | ||
| ])); | ||
|
|
||
| let group_keys = [2, 3, 4, 4].repeat(1_000); |
Contributor
Author
There was a problem hiding this comment.
The old implementation set a very tight memory budget, and the refactored implementation might have minor implementation difference, making this test fail.
Here it just try to scale up the test input size and memory limit, the test target is the same.
| async fn test_aggregate_with_spill_if_necessary() -> Result<()> { | ||
| // test with spill | ||
| run_test_with_spill_pool_if_necessary(2_000, true).await?; | ||
| run_test_with_spill_pool_if_necessary(20_000, true).await?; |
Contributor
Author
There was a problem hiding this comment.
Here is the same as the previous note on test change.
| matches!(root, DataFusionError::ResourcesExhausted(_)), | ||
| "Expected ResourcesExhausted, got: {root}", | ||
| ); | ||
| let msg = root.to_string(); |
Contributor
Author
There was a problem hiding this comment.
Above check on error type is enough I think, here it also assert the exact error message
| /// See comments at `poll_next()` for details. | ||
| /// | ||
| /// Returns the next operator state with control flow decision. | ||
| fn handle_producing_output( |
Contributor
Author
There was a problem hiding this comment.
This function has no functional changes, the diffs are
- use internal_err instead of assert
- simplify some control flow code with
break_with_err
| SET datafusion.execution.target_partitions = 1 | ||
|
|
||
| statement ok | ||
| SET datafusion.execution.batch_size = 128 |
Contributor
Author
There was a problem hiding this comment.
similar to the above notes on the test change #23965 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #22710
Rationale for this change
This PR implements larger-than-memory execution for single mode aggregation.
See top comments at
single_stream.rsfor the high-level idea. The key implementations are in the same file.What changes are included in this PR?
Are these changes tested?
Existing tests.
Are there any user-facing changes?
No