Repository navigation
Fix mutations of compact parts with statistics - #97140
Merged
Merged
Conversation
Contributor
|
Workflow [PR], commit [c42b6b6] Summary: ❌
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in mutations of compact parts with automatic statistics. When replicas in a ReplicatedMergeTree load metadata changes from ZooKeeper, they were not re-adding implicit statistics (defined by auto_statistics_types setting), causing mutations to produce incorrect statistics cardinality values.
Changes:
- Fixed
setTableStructurein StorageReplicatedMergeTree to re-add implicit statistics after loading metadata from ZooKeeper - Updated test to use compact parts (removed
min_bytes_for_wide_part = 0setting) to properly test the mutation scenario - Updated expected test output to reflect correct cardinality of 1 instead of incorrect value of 2
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Storages/StorageReplicatedMergeTree.cpp | Added code to re-add implicit statistics after loading metadata from ZK, following the same pattern used in StorageMergeTree::alter |
| tests/queries/0_stateless/03919_modify_nullable_statistics.sql | Removed min_bytes_for_wide_part = 0 setting to test with compact parts (default behavior) |
| tests/queries/0_stateless/03919_modify_nullable_statistics.reference | Updated expected output to show correct cardinality of 1 after mutation |
antaljanosbenjamin
approved these changes
Feb 17, 2026
Merged
via the queue into
ClickHouse:master
with commit Feb 17, 2026
eb563c7
146 of 149 checks passed
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.
Changelog category (leave one):
Bugfix for unreleased feature.
Version info
26.2.1.834