Skip to content

Failure: /aggregate functions/part 3/state/sumCountState/* — snapshots outdated after 26.1.6 serialization fix #125

@CarlosFelipeOR

Description

@CarlosFelipeOR

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:

  1. 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).

  2. Feb 27, 2026 — Our >=26.1 snapshot files were created reflecting this new behavior with the 01 prefix.

  3. 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.

  4. 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.

  5. Mar 20, 2026 — ClickHouse v26.1.6.6-stable was released, including the fix.

  6. 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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions