v.22.10Improvement

Fix Invalid Cast of Aggregate State Types with Complex Types

Fix rarely invalid cast of aggregate state types with complex types such as Decimal. This fixes #42408. #42417 (Amos Bird).
Fixes an issue with invalid type casting of aggregate states involving complex types such as Decimal in ClickHouse aggregation functions.

Why it matters

Addresses and resolves a rare bug where aggregate state types with complex data types like Decimal were incorrectly cast, leading to potential errors during query execution. This improves reliability and correctness when working with aggregate functions on complex numerical types.

How to use it

Users benefit from this fix automatically upon upgrading to the version containing this patch. No special configuration or changes in query syntax are required.