v.23.9New Feature
Added Date Conversion Functions for Integer Encoded Dates
Added functionsYYYYMMDDtoDate,YYYYMMDDtoDate32,YYYYMMDDhhmmssToDateTimeandYYYYMMDDhhmmssToDateTime64. They convert a date or date with time encoded as integer (e.g. 20230911) into a native date or date with time. As such, they provide the opposite functionality of existing functionsYYYYMMDDToDate,YYYYMMDDToDateTime,YYYYMMDDhhmmddToDateTime,YYYYMMDDhhmmddToDateTime64. #54509 (Quanfa Fu) (Robert Schulze).
Why it matters
These functions provide the inverse conversion of existing functions likeYYYYMMDDToDate and YYYYMMDDToDateTime, enabling users to parse integer-encoded date/time values into native ClickHouse date/time types. This solves the problem of converting compact numeric representations commonly found in external systems or data formats into ClickHouse's date/time types for easier querying and analysis.How to use it
Use the new functions to convert integer-based date or datetime values into native ClickHouse types. For example:SELECT YYYYMMDDtoDate(20230911), YYYYMMDDhhmmssToDateTime(20230911123045);This will output native
Date and DateTime values from integer inputs.