v.18.12New Feature

Added DECIMAL Data Type Support in ClickHouse

Added the DECIMAL(digits, scale) data type (Decimal32(scale), Decimal64(scale), Decimal128(scale)). To enable it, use the setting allow_experimental_decimal_type. #2846 #2970 #3008 #3047
Added support for the DECIMAL(digits, scale) data type, including Decimal32(scale), Decimal64(scale), and Decimal128(scale) variants in ClickHouse.

Why it matters

The new DECIMAL data type provides fixed-point numeric precision, enabling accurate representation and calculation of decimal numbers with user-defined precision and scale. This feature solves issues related to floating-point inaccuracies and improves support for financial and scientific data involving precise decimal values.

How to use it

To enable the DECIMAL data type, set the setting allow_experimental_decimal_type to 1. Then define columns using syntax like DECIMAL(precision, scale) or the specific types Decimal32(scale), Decimal64(scale), and Decimal128(scale) in table schemas.