BigData / Apache Parquet Interview Questions
What are best practices for writing Parquet files in production?
Producing high-quality Parquet files that perform well at query time requires attention at write time:
- Target 128 MB–512 MB row groups — too small wastes footer reads; too large makes predicate skipping coarse.
- Sort data before writing on filter columns — tight min/max ranges per row group dramatically improve skipping.
- Choose the right compression codec — ZSTD for I/O-bound workloads; Snappy for CPU-bound (fast decompression).
- Enable dictionary encoding on low-cardinality columns — automatic in most frameworks but verify it is not being disabled.
- Partition on moderate-cardinality columns (e.g., date, country) — never on user IDs or UUIDs.
- Avoid tiny files — compact regularly if streaming or incremental writes produce many small files.
- Enable Bloom filters on high-cardinality equality columns (UUIDs, hashed IDs).
- Embed correct schema types — use TIMESTAMP_MICROS not INT96 (deprecated); use DECIMAL not DOUBLE for monetary values.
- Test with query benchmarks after schema changes to confirm no regression in pushdown effectiveness.
What is the recommended row group size range for production Parquet files?
Why is the deprecated INT96 timestamp type being replaced by TIMESTAMP_MICROS in Parquet?
More Related questions...