v.25.6New Feature

New data types: Time ([H]HH:MM:SS) and Time64

New data types: Time ([H]HH:MM:SS) and Time64 ([H]HH:MM:SS[.fractional]), and some basic cast functions and functions to interact with other data types. Added settings for compatibility with the existing function toTime. The setting use_legacy_to_time is set to keep the old behavior for now. #81217 (Yarik Briukhovetskyi). Support comparison between Time/Time64. #80327 (Yarik Briukhovetskyi).
Introduces new data types Time (formatted as [H]HH:MM:SS) and Time64 (formatted as [H]HH:MM:SS[.fractional]), along with basic cast functions and interaction functions for these types. Enables comparison operations between Time and Time64 values.

Why it matters

These additions provide more precise and flexible time data representation by allowing fractional seconds with Time64 and improving compatibility with existing time functions. The enhancement solves the limitation of handling and comparing time values with higher precision and broadens ClickHouse's data type capabilities for time-related use cases.

How to use it

Users can start using the Time and Time64 data types in their table schemas and queries. To maintain compatibility with the existing toTime function behavior, the use_legacy_to_time setting is provided and enabled by default for now. Comparisons between Time and Time64 values are supported directly in queries.