v.22.9Improvement
More natural conversion of Date types to narrower types in ClickHouse
More natural conversion ofDate32,DateTime64,Dateto narrower types: upper or lower normal value is considered when out of normal range. #40217 (Andrey Zvonov).
Why it matters
This feature addresses issues with converting date and datetime types to narrower types by ensuring conversions use the closest valid boundary value instead of failing or producing invalid results. It enhances data compatibility and reduces errors when downcasting date/time types.How to use it
The improved conversion behavior is applied automatically during type casting operations involvingDate32, DateTime64, or Date to narrower date/time types. No additional configuration is required.