Skip to content

Conversation

@dqhl76
Copy link
Collaborator

@dqhl76 dqhl76 commented Dec 25, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This is part of #19155 (part 2)

Refactor new aggregate spiller streams and add a spill reader, deprecating the unused max_partition_count in restored payloads.
Extract aggregate-function descriptor building into a shared helper for final aggregate planning.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@dqhl76 dqhl76 changed the title Refactor aggregate spiller streams refactor: refactor aggregation spiller Dec 25, 2025
@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Dec 25, 2025
@dqhl76 dqhl76 marked this pull request as draft December 25, 2025 08:18
@dqhl76 dqhl76 changed the title refactor: refactor aggregation spiller refactor: refactor partition stream in aggregation spiller Dec 25, 2025
self.finish_count = 0;

let ids = self.partition_stream.partition_ids();
pub struct LocalPartitionStream {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the new final aggregator handles partitioned(isolate) data, we can remove the lock on the shared partition stream to reduce contention.

}
}

pub struct NewAggregateSpillReader {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Split a reader from the spiller. It does not need to create partition stream.

@dqhl76
Copy link
Collaborator Author

dqhl76 commented Jan 7, 2026

included in #19155

@dqhl76 dqhl76 closed this Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-refactor this PR changes the code base without new features or bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant