Repository navigation
Add coverage tests for ROLLUP/CUBE/GROUPING SETS with external aggregation (PR #99228) - #99776
Merged
alexey-milovidov merged 2 commits intoMar 19, 2026
Conversation
…ation (PR ClickHouse#99228) PR ClickHouse#99228 replaces `Block` with `Chunk` throughout the aggregation pipeline (17 files). Two correctness paths had no test coverage: 1. `04046`: ROLLUP and CUBE with external aggregation (`max_bytes_before_external_group_by = 1`) – exercises `writeToTemporaryFileImpl` and `GroupByModifierTransform::merge()`. Verifies results match for ROLLUP/CUBE with and without `group_by_use_nulls`. 2. `04047`: GROUPING SETS with external aggregation + `group_by_two_level_threshold = 1` – exercises `MergingAggregatedTransform::addChunk`, `mergeBlocks(BucketToChunks)`, and `convertBlockToTwoLevel`. Includes a single-set path to cover the reordering branch. Both tests pass, confirming the refactoring preserves correctness on these paths. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
zlareb1
marked this pull request as ready for review
March 18, 2026 11:41
alexey-milovidov
approved these changes
Mar 19, 2026
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.
PR #99228 replaces
BlockwithChunkthroughout the aggregation pipeline (17 files). Two code paths that handle spill-to-disk had no correctness test coverage.Coverage gap 1 — ROLLUP/CUBE with external aggregation (
04046)GroupByModifierTransform::merge()andwriteToTemporaryFileImplare exercised when ROLLUP or CUBE queries trigger external aggregation. The only existing test (04023_rollup_totals_memory_limit.sql) only checks that a memory-limit error is raised, not that results are correct.04046_rollup_cube_with_external_group_by.sqlruns ROLLUP and CUBE withmax_bytes_before_external_group_by = 1and compares the output against the same queries without spilling, for bothgroup_by_use_nulls = 0and= 1.Coverage gap 2 — GROUPING SETS with external aggregation + two-level threshold (
04047)MergingAggregatedTransform::addChunk,mergeBlocks(BucketToChunks), andconvertBlockToTwoLevelare exercised when GROUPING SETS queries trigger both external aggregation and two-level bucketing. No existing test covered this combination.04047_grouping_sets_with_external_group_by.sqlruns multi-set and single-set GROUPING SETS withmax_bytes_before_external_group_by = 1andgroup_by_two_level_threshold = 1, comparing against the same queries without those settings.Both tests pass on current master, confirming the refactoring preserves correctness on these paths.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes