v.21.9New Feature

Add Date32 Datatype and toDate32 Function to ClickHouse

Add a new datatype Date32 (store data as Int32), support date range same with DateTime64 support load parquet date32 to ClickHouse Date32 Add new function toDate32 like toDate. #25774 (LiuNeng).
Introduces a new data type Date32 in ClickHouse that stores dates as Int32, supporting a wider date range similar to DateTime64. Also adds the function toDate32 for date conversion.

Why it matters

The Date32 data type addresses the limitation of the existing Date type by enabling storage of dates with a larger range, allowing for easier handling of dates outside the standard Date range. This is particularly valuable for users importing data from formats like Parquet with date32 fields. It enhances compatibility and flexibility in date processing within ClickHouse.

How to use it

Users can create table columns with the Date32 type directly, and convert values to this type using the new function toDate32, similar to how toDate is used. Parquet files containing date32 fields can now be loaded natively into ClickHouse Date32 columns.