Skip to content

sumCountIf and sumCountDistinct serialization compatibilityafter Nullable(Tuple) introduction (follow-up to #97502) #98917

@zlareb1

Description

@zlareb1

Describe what's wrong

Does it reproduce on the most recent release?

Yes

How to reproduce

Verified post #97502 merge:

  -- sumCountIf: old state fails
  SELECT finalizeAggregation(CAST(
      unhex('0A0000000000000004'),
      'AggregateFunction(sumCountIf, Nullable(UInt8), UInt8)'
  ));
Received exception:
Code: 32. DB::Exception: Attempt to read after eof: In scope SELECT finalizeAggregation(CAST(unhex('0A0000000000000004'), 'AggregateFunction(sumCountIf, Nullable(UInt8), UInt8)')). (ATTEMPT_TO_READ_AFTER_EOF)

  -- sumCountDistinct: old state fails
  SELECT finalizeAggregation(CAST(
      unhex('03000201'),
      'AggregateFunction(sumCountDistinct, Nullable(UInt8))'
  ));
Received exception:
Code: 36. DB::Exception: AggregateFunction state for `sumCountDistinct` has 2 trailing byte(s) after deserialization: In scope SELECT finalizeAggregation(CAST(unhex('03000201'), 'AggregateFunction(sumCountDistinct, Nullable(UInt8))')). (BAD_ARGUMENTS)

  -- sumCount IS fixed for reference:
  SELECT finalizeAggregation(CAST(
      unhex('0A0000000000000004'),
      'AggregateFunction(sumCount, Nullable(UInt8))'
  ));
  -- (10,4) ✓

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions