File Formats & Compression

Parquet, Avro, ORC and the text formats they replaced. Row groups, column chunks, statistics, encodings — what a format actually stores, and what that lets a reader skip.

Why Analytical Data Compresses

Columns of one type with repeating values compress in ways rows of mixed types cannot — and the chain from fewer bytes to a faster query has three places it can break.

Q · Why does the same dataset shrink dramatically when stored column by column, and why does that not automatically make queries faster?
Dictionary, Run-Length, Delta and Bit Packing

Four type-aware encodings, what redundancy each one exploits, and the column property — cardinality, sortedness, range — that decides whether it does anything at all.

Q · Which property of a column decides whether an encoding shrinks it, and how would I know which encoding my writer actually chose?
Parquet

A self-describing, columnar, splittable file whose footer tells a reader what it can skip — which is a different claim from "it is smaller".

Q · What does a Parquet file physically contain that a compressed CSV does not, and which of those things does a query actually use?
Parquet Internals

Row groups, column chunks, pages and the footer — where statistics come from, why they are only useful when the data is sorted, and how nesting is stored without abandoning columns.

Q · A query filters on `event_date` and my engine still reads every row group. What in the file decides whether a row group can be skipped?
The Parquet Read Path

Follow `SELECT country, revenue FROM events WHERE date = '2026-08-25'` from a directory listing to decoded values, and count what got skipped at each of the four gates.

Q · For one concrete query against a partitioned Parquet dataset, exactly which bytes are read and which are never touched?
Avro

Row-oriented binary records with the schema travelling alongside the data — built for exchange and evolution rather than for scanning one column across a billion rows.

Q · When is storing whole records together the right answer, and what does carrying the schema with the data actually buy?
ORC

A sibling columnar design with the same goals and different specifics: stripes instead of row groups, row-index strides for finer skipping, and row-level ACID in the ecosystem it grew up in.

Q · ORC and Parquet solve the same problem — so what is actually different, and when does the difference decide anything?
Parquet vs Avro

Not a rivalry. One is built for reading a few columns across many rows, the other for handling whole records one at a time — and most pipelines use both, in that order.

Q · For this specific hop, does the consumer read a few columns across many records, or every field of a few records at a time?
CSV, JSON and Their Limits

No types, no schema, no statistics, ambiguous quoting and — for CSV — a splittability problem that has no clean fix. And still the right answer for interchange, small data and human inspection.

Q · What exactly does a text format fail to store, and when is that failure irrelevant?