DuckDB to Apache Parquet round-trip type fidelity for TIMESTAMPTZ and INTERVAL
0 reputation · 02 Feb 2022, 15:27 UTC
Goal
Determine whether DuckDB preserves TIMESTAMP WITH TIME ZONE and INTERVAL columns through a write-to-Parquet then read-from-Parquet cycle without changing the SQL type or losing values.
Constraints
DuckDB offers read_parquet() and COPY ... TO ... (FORMAT PARQUET), but INTERVAL and TIMESTAMP WITH TIME ZONE lack an exact Parquet primitive. They may be written as annotated or converted logical types, and read_parquet() infers schemas by sampling files. Exact annotations vary by DuckDB release, and external consumers can strip metadata.
For the installed DuckDB release, what behavior should be expected at this integration boundary?
- Does read_parquet() restore the original TIMESTAMP WITH TIME ZONE and INTERVAL types after a Parquet write?
- Is an explicit schema required on read to prevent type widening or annotation loss?