File Formats Quick Reference

A compact lookup for row vs. column layout, Parquet structure, encoding and compression, pushdown, disk partitioning, and Avro compatibility rules.

Choosing a layout#

Read patternLayoutExample
Whole record, one at a timeRow-orientedAvro, a Kafka message
Few columns, many rowsColumn-orientedParquet, ORC

Parquet structure#

Text
File -> Row group (batch of rows)          -> Column chunk (one column's values in this row group)              -> Page (smallest decompressed unit)     -> Footer: schema + per-column-chunk min/max/null-count stats
Python
import pandas as pddf = pd.read_parquet("orders.parquet", columns=["order_id", "amount"])

Encoding vs. compression#

LayerTechniquesUses column structure?
EncodingDictionary, run-length, deltaYes — same idea as Pandas category
CompressionSnappy, gzip, ZstdNo — generic byte-level
Text
Snappy: fastest, lowest ratio       Zstd: fast, tunable, strong ratioGzip:   slower, higher ratio

Pushdown#

Text
Projection pushdown:  read only referenced columnsPredicate pushdown:   skip row groups whose min/max can't match                       (breaks if the filter wraps the column in a                       function, e.g. WHERE UPPER(status) = 'X')Partition pruning:    skip whole files/directories by path,                       before opening any of them

Hive-style disk partitioning#

Layout popularized by Apache Hive; Apache Iceberg and similar table formats track this metadata explicitly instead of inferring it from paths.

Text
orders/year=2026/month=06/part-0001.parquet
Partition columnGood choice?
order_date (moderate cardinality, often filtered)Yes
customer_id / UUID (high cardinality)No — small-files problem

Avro schema compatibility#

ChangeSafe?
Add a field with a defaultYes (backward compatible)
Remove a field that had a defaultYes (backward compatible)
Rename a fieldNo — looks like remove + unrelated add
Change a field's type incompatiblyNo
Text
Backward: new schema reads old data     Full: both directions hold —Forward:  old schema reads new data     producers/consumers upgrade in any order

Further reading#

See also#