v.24.1Improvement

MySQL Interface Enhancements: Support for CAST to SIGNED and UNSIGNED Data Types

MySQL interface gained support for CAST(x AS SIGNED) and CAST(x AS UNSIGNED) statements via data type aliases: SIGNED for Int64, and UNSIGNED for UInt64. This improves compatibility with BI tools such as Looker Studio. #58954 (Serge Klochkov).
The MySQL interface in ClickHouse now supports CAST(x AS SIGNED) and CAST(x AS UNSIGNED) statements by introducing data type aliases SIGNED for Int64 and UNSIGNED for UInt64.

Why it matters

This feature improves compatibility with BI tools, such as Looker Studio, that rely on MySQL syntax for casting signed and unsigned integers. It helps users seamlessly integrate ClickHouse with these tools without altering their existing queries.

How to use it

Users can now use MySQL-style casts in their queries via the MySQL interface, for example:

SELECT CAST(column_name AS SIGNED) FROM table_name;
SELECT CAST(column_name AS UNSIGNED) FROM table_name;

This works automatically as SIGNED and UNSIGNED are mapped to Int64 and UInt64 respectively.