v.20.4New Feature

Support DATE and TIMESTAMP SQL Operators

Support DATE and TIMESTAMP SQL operators, e.g. SELECT date '2001-01-01' #9691 (Artem Zuikov)
Support for DATE and TIMESTAMP SQL literals, enabling users to write date and timestamp constants directly in queries.

Why it matters

This feature introduces the ability to use SQL standard date and timestamp literals like DATE 'YYYY-MM-DD' and TIMESTAMP 'YYYY-MM-DD HH:MM:SS' in ClickHouse queries. It simplifies the expression of date and time constants and improves SQL compatibility, making it easier to write and maintain queries involving dates and times.

How to use it

Users can now write SQL queries using date and timestamp literals directly, for example:

SELECT date '2001-01-01'


or

SELECT timestamp '2001-01-01 12:34:56'


No additional settings or configuration is required to enable this feature; it works out-of-the-box in ClickHouse SQL queries.