v.20.8New Feature
Add countDigits and isDecimalOverflow functions to ClickHouse
AddcountDigits(x)function that count number of decimal digits in integer or decimal column. AddisDecimalOverflow(d, [p])function that checks if the value in Decimal column is out of its (or specified) precision. #14151 (Artem Zuikov).
Why it matters
These functions help users to analyze and validate numeric data by accurately counting digits and detecting decimal overflow errors. This enhances data quality checks and simplifies handling of precision issues in decimal columns.How to use it
UsecountDigits(x) by passing an integer or decimal column to return the count of decimal digits. Use isDecimalOverflow(d, [p]) by passing a Decimal column and optionally a precision value p to determine if the value exceeds that precision, returning a boolean result.