A logical type adds semantic meaning to a physical storage type, telling readers how to interpret the stored value. Parquet stores dates physically as numeric values while metadata identifies them as dates. This preserves compact storage while enabling date-aware operations. section 5.4 section 5.5
Use logical types when converting loosely typed source data into a self-describing Parquet schema:
- Inspect CSV values before export because CSV columns are typically strings or require sampling to infer types. section 5.4
- Convert encoded values such as 20000110 into a proper DATE rather than leaving them as sortable but awkward integers. section 5.4
- Inspect Parquet metadata to distinguish the physical type on disk from its logical interpretation. section 5.5
Converting an encoded ranking date
SELECT * REPLACE (cast(strptime(ranking_date::VARCHAR, '%Y%m%d') AS DATE) AS ranking_date) FROM 'atp/atp_rankings_*.csv' LIMIT 5; The resulting column is typed as DATE and displays values such as 2000-01-10, allowing SQL date manipulation functions to use it.

