v.21.6New Feature

Make Big Integers Production Ready with Enhanced Support for Data Types and Functions

Make big integers production ready. Add support for UInt128 data type. Fix known issues with the Decimal256 data type. Support big integers in dictionaries. Support gcd/lcm functions for big integers. Support big integers in array search and conditional functions. Support LowCardinality(UUID). Support big integers in generateRandom table function and clickhouse-obfuscator. Fix error with returning UUID from scalar subqueries. This fixes #7834. This fixes #23936. This fixes #4176. This fixes #24018. Backward incompatible change: values of UUID type cannot be compared with integer. For example, instead of writing uuid != 0 type uuid != '00000000-0000-0000-0000-000000000000'. #23631 (alexey-milovidov).
Introduces production-ready support for the UInt128 data type and improves handling of big integers, including fixes for Decimal256. Enhances big integer compatibility in dictionaries, array functions, and utilities such as generateRandom and clickhouse-obfuscator. Adds support for LowCardinality(UUID) and gcd/lcm functions for big integers. Resolves multiple related issues and fixes errors with returning UUID from scalar subqueries.

Why it matters

This feature addresses the need for robust, high-precision integer support in ClickHouse by making big integers production ready. It resolves known bugs and limitations with big integer types like UInt128 and Decimal256, improves their integration across various functionalities and data structures, and ensures compatibility and correctness, particularly with UUID handling. The update also clarifies type comparison rules, which prevents subtle bugs in user queries.

How to use it

Users can start utilizing UInt128 data type directly in their table schemas and queries. Big integers are fully supported in dictionaries, array functions, and conditional expressions without additional configuration. The gcd and lcm functions can now be applied to big integer types. Note the backward incompatible change: comparisons between UUID and integers are disallowed, so write comparisons explicitly with the UUID string literal, for example, uuid != '00000000-0000-0000-0000-000000000000' instead of uuid != 0.