Affected tests:
/aggregate functions/part 3/state/sumCountState/Nullable(*)
/aggregate functions/part 3/state/sumCountState/LowCardinality(Nullable(*))
/aggregate functions/part 2/finalizeAggregation/sumCount_finalizeAggregation_Merge/*
/aggregate functions/part 3/merge/sumCountMerge/*
Affected files:
aggregate_functions/tests/sumCount.py
aggregate_functions/regression.py
aggregate_functions/tests/snapshots/steps.py.sumcountstate>=26.1.x86_64.snapshot
aggregate_functions/tests/snapshots/steps.py.sumcountstate>=26.1.aarch64.snapshot
Description
After Altinity PR #1578 bumped antalya-26.1 to the upstream 26.1.6 base, the sumCountState tests for Nullable types started failing consistently. The snapshot comparison showed a mismatch in serialized hex values:
- Expected (snapshot):
"011C0400000000000009" (with 01 prefix)
- Actual (26.1.6):
"1C0400000000000009" (without 01 prefix)
Analysis
Root Cause
This is a test issue, not a ClickHouse bug. The timeline:
-
ClickHouse 26.1.1 introduced Nullable(Tuple) support (PR #96239), which changed sumCountState serialization for Nullable arguments by adding a leading 01 byte (null-flag).
-
Feb 27, 2026 — Our >=26.1 snapshot files were created reflecting this new behavior with the 01 prefix.
-
Feb 19, 2026 — Upstream ClickHouse reported this as a bug (Issue #97370): the extra byte broke backward compatibility with states serialized by older ClickHouse versions.
-
Mar 5, 2026 — The fix (PR #97502) was merged and backported to 26.1 (PR #98818). The fix forces sumCount to use the legacy null adapter, removing the extra 01 byte and restoring the original serialization format.
-
Mar 20, 2026 — ClickHouse v26.1.6.6-stable was released, including the fix.
-
Altinity PR #1578 bumped to v26.1.6 upstream base, which includes the fix. The tests now produce output without the 01 prefix, matching the pre-26.1 behavior, but the >=26.1 snapshots still expected the buggy 01 prefix.
Impact
The >=26.1 versioned snapshots for sumCountState were created during the window when 26.1 had the buggy serialization. After the fix was backported, these snapshots became incorrect. The original (non-versioned) snapshots have the correct values.
Solution
- Deleted the outdated
>=26.1 snapshot files (they reflected the buggy behavior)
- Removed the version-branching logic in
sumCount.py that selected those snapshots
- Removed the XFails in
regression.py for sumCountMerge and sumCount_finalizeAggregation_Merge that referenced issue #97370
Fix commit: dbfe34f
References
Affected tests:
/aggregate functions/part 3/state/sumCountState/Nullable(*)/aggregate functions/part 3/state/sumCountState/LowCardinality(Nullable(*))/aggregate functions/part 2/finalizeAggregation/sumCount_finalizeAggregation_Merge/*/aggregate functions/part 3/merge/sumCountMerge/*Affected files:
aggregate_functions/tests/sumCount.pyaggregate_functions/regression.pyaggregate_functions/tests/snapshots/steps.py.sumcountstate>=26.1.x86_64.snapshotaggregate_functions/tests/snapshots/steps.py.sumcountstate>=26.1.aarch64.snapshotDescription
After Altinity PR #1578 bumped
antalya-26.1to the upstream 26.1.6 base, thesumCountStatetests for Nullable types started failing consistently. The snapshot comparison showed a mismatch in serialized hex values:"011C0400000000000009"(with01prefix)"1C0400000000000009"(without01prefix)Analysis
Root Cause
This is a test issue, not a ClickHouse bug. The timeline:
ClickHouse 26.1.1 introduced
Nullable(Tuple)support (PR #96239), which changedsumCountStateserialization for Nullable arguments by adding a leading01byte (null-flag).Feb 27, 2026 — Our
>=26.1snapshot files were created reflecting this new behavior with the01prefix.Feb 19, 2026 — Upstream ClickHouse reported this as a bug (Issue #97370): the extra byte broke backward compatibility with states serialized by older ClickHouse versions.
Mar 5, 2026 — The fix (PR #97502) was merged and backported to 26.1 (PR #98818). The fix forces
sumCountto use the legacy null adapter, removing the extra01byte and restoring the original serialization format.Mar 20, 2026 — ClickHouse v26.1.6.6-stable was released, including the fix.
Altinity PR #1578 bumped to v26.1.6 upstream base, which includes the fix. The tests now produce output without the
01prefix, matching the pre-26.1 behavior, but the>=26.1snapshots still expected the buggy01prefix.Impact
The
>=26.1versioned snapshots forsumCountStatewere created during the window when 26.1 had the buggy serialization. After the fix was backported, these snapshots became incorrect. The original (non-versioned) snapshots have the correct values.Solution
>=26.1snapshot files (they reflected the buggy behavior)sumCount.pythat selected those snapshotsregression.pyforsumCountMergeandsumCount_finalizeAggregation_Mergethat referenced issue #97370Fix commit: dbfe34f
References
sumCountaggregate function not being able to read older serialized states after introduction ofNullable(Tuple)ClickHouse/ClickHouse#97502sumCountaggregate function not being able to read older serialized states after introduction ofNullable(Tuple)ClickHouse/ClickHouse#98818