v.23.5New Feature
Allow CASE without ELSE and enhance transform function in ClickHouse
Allow the use ofCASEwithout anELSEbranch and extendedtransformto deal with more types. Also fix some issues that made transform() return incorrect results when decimal types were mixed with other numeric types. #48300 (Salvatore Mesoraca). This closes #2655. This closes #9596. This closes #38666.
Why it matters
This feature improves SQL query flexibility by enablingCASE expressions without an explicit ELSE branch, preventing errors or unexpected behavior when ELSE is omitted. Additionally, it enhances the transform function to correctly handle mixed numeric types, especially decimals, ensuring accurate results and broader applicability.How to use it
Users can writeCASE expressions without an ELSE branch as usual, relying on the default NULL result when no condition matches. For transform, simply use the function with supported new data types and mixed decimal/numeric arguments without any special configuration; the function now correctly processes these cases.