SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
  • Batch vs Stream Processing
  • Change Data Capture (CDC)
  • MapReduce
  • ETL Pipelines
  • Data Lakes
  • Data Warehousing
  • Data Lakehouse
  • Lambda Architecture
  • Kappa Architecture
  • Streaming Engines
  • Spark and Hadoop
  • Workflow Orchestration (Airflow)
  • Parquet and Columnar File Formats
  • Data Governance and Feature Stores
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Advanced Data Topics/Big Data Processing

Parquet and Columnar File Formats

Store data column by column in files, so analytics read less and compress better.

⏱ 13 min readIntermediateInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

Parquet is a file format that stores a table column by column instead of row by row. A query that needs 2 of 50 columns reads only those 2, and the footer's min/max statistics let it skip whole chunks of rows without opening them.

  • Column pruning: read only the columns the query uses.
  • Predicate pushdown: use min/max stats to skip row groups that cannot match the filter.
  • Small files: similar values sit together, so encoding and compression work very well.
  • It is the default file format of data lakes, Spark and most analytics engines.

02Concept: What is it?

A row-based file (CSV, JSON, Avro) writes row 1 fully, then row 2, and so on. That is perfect for "give me the whole record for user 42". But analytics asks questions like "the average amount by country over a billion rows". That needs two columns out of dozens. With a row file, the reader still has to go past every other column in every row.

A columnar file writes all values of column 1 together, then all of column 2, and so on. Now the average-by-country query reads two blocks and ignores the rest. This general idea is covered in the Columnar Databases page. This page is about the file layout that makes it work on a lake.

Row layout vs column layout on disk
Row-based file
1️⃣1, DE, free, 12, Mon
2️⃣2, FR, pro, 20, Tue
3️⃣3, US, pro, 95, Wed
Columnar file
🧱id: 1, 2, 3
🧱country: DE, FR, US
🧱amount: 12, 20, 95
The same four rows. The query only needs country and amount.

A Parquet file is not one long column, though. It is cut into row groups (typically a few hundred thousand to millions of rows each). Inside each row group, every column is stored as a column chunk, cut into pages. At the very end is a footer with the schema, where each chunk lives and statistics such as the min and max of each chunk.

🧠The footer is read first
A reader opens the file, jumps to the end, reads the footer, and only then decides which chunks to fetch. That is what makes skipping possible, even on cloud object storage.

03Real-Life Example

🍵The Filing Cabinet and the Index Cards
Imagine a company that keeps one folder per customer, each with name, address, phone and order total. To find the total of every order you must open every folder. Now imagine instead a cabinet with a drawer for all names, a drawer for all addresses and a drawer for all order totals, each drawer split into bundles with a note on the front: "totals in this bundle: lowest 3, highest 80". To find totals above 90, you open only one drawer, and skip every bundle whose note says the highest is 80.
Cabinet
Parquet
A drawer for one kind of information
A column
A bundle inside a drawer
A column chunk in a row group
The note on the front of the bundle
Min and max statistics
Skipping a bundle that cannot match
Row-group skipping (predicate pushdown)
Not opening the drawers you do not need
Column pruning
The index at the front of the cabinet
The file footer
Squeezing the same words into one short list
Dictionary encoding

04Why Do We Need It?

📉Read far less
Analytics touch a few columns. Reading only those can cut I/O by 10x or more.
🗜️Compress well
Values in one column look alike (the same countries, dates and numbers), so they pack tightly.
⏭️Skip with statistics
Min and max per chunk let a filter skip whole blocks of rows without reading them.
💰Cheaper queries
Pay-per-scan engines (Athena, BigQuery on external tables) charge for bytes read.
🔌Open and shared
Spark, Trino, Hive, DuckDB, pandas and warehouses all read Parquet.
🧬Typed and self-describing
The schema lives in the file, so nobody has to guess that a column is a number.
Parquet turns “scan everything” into “read just the columns and chunks that can matter”.

05Where Do We Use It?

🗃️Data lakes
The common file format in the cleaned and curated zones.
🧊Lakehouse tables
Delta Lake, Iceberg and Hudi store their data as Parquet files plus a transaction log.
⚡Spark and Trino
Their usual input and output for big jobs and interactive SQL.
🧾Warehouse loads and exports
Snowflake, BigQuery and Redshift load from and unload to Parquet.
🤖ML feature data
Training sets are stored as Parquet so they can be scanned fast by columns.
📦Archives
Compact, typed and queryable later, so it makes a good long-term format.

06Types / Parts / How It Works

Inside one Parquet file

File, row groups, column chunks, pages
📄Parquet file
↓
Row group 1
🧱chunk: countrypages, min DE, max FR
🧱chunk: amountpages, min 8, max 20
Row group 2
🧱chunk: countrypages, min FR, max US
🧱chunk: amountpages, min 80, max 150
↓
📑Footerschema, chunk locations, statistics
The footer at the end points to everything and carries the statistics.

The tricks that make it small and fast

TrickWhat it doesBest for
Column pruningReads only the chunks of the needed columnsWide tables, narrow queries
Row-group skippingUses min/max to skip groups that cannot match a filterFilters on sorted or clustered columns
Dictionary encodingStores each distinct value once, then small numbersColumns with few distinct values (country, status)
Run-length encodingStores “DE × 400” instead of 400 copiesSorted or repeating values
Delta encodingStores the differences between neighbouring numbersTimestamps and IDs that grow
Compression (Snappy, Zstd, Gzip)Squeezes each page after encodingEverything. Snappy is fast, Zstd compresses more

Row-based vs columnar formats

FormatLayoutGood atWeak at
ParquetColumnarAnalytics, scans over a few columnsSingle-row lookups and frequent small writes
ORCColumnarHive and Hadoop analytics, with built-in indexesLess support outside the Hadoop world
AvroRow-basedStreaming records, schema evolution, KafkaColumn scans
CSV / JSONRow-based textHuman readable, easy to startLarge, slow, no types or stats
Data (chunks) Footer (metadata)
VisualizerHow many bytes does the query read?Run each query on a row-based file and on Parquet. With Parquet, pick “Two columns + filter” and see a whole row group skipped because its max amount is too small. Then try SELECT * and see when columnar does not help.
File layout
Query
SELECT country, amount FROM sales WHERE amount > 90
 id
8 B each
country
4 B each
plan
4 B each
amount
8 B each
day
4 B each
Rows 1–4 (stored row after row)
row 11DEfree12Mon
row 22DEfree8Mon
row 33FRpro20Tue
row 44DEfree15Tue
Rows 5–8 (stored row after row)
row 55USpro95Wed
row 66USteam120Wed
row 77FRteam80Thu
row 88USpro150Thu
Bytes read
224
of 224 B in the table
Share of table
100%
smaller is better
Cells read
40 / 40
A row-based file stores each row together, one after the other. To find any column the reader walks past every other column too, so the whole file is read, whatever the query asks for.

A toy table with made-up byte sizes, just to show the idea. Real Parquet also compresses and encodes each column chunk, so real savings are usually larger. Row groups hold millions of rows in practice, not four.

07How to Use It / Steps / Implementation

Using Parquet well

  1. 1
    Write Parquet for analytics data
    Keep row formats like Avro for event streams and Parquet for what gets queried.
  2. 2
    Aim for big files
    Files of roughly 128 MB to 1 GB work well. Thousands of tiny files slow every query.
  3. 3
    Sort or cluster by the filter column
    If rows with similar values sit together, min/max ranges are tight and more row groups are skipped.
  4. 4
    Partition folders by a low-cardinality column
    A path like date=2026-01-15 lets the engine skip whole folders. Do not partition by user ID.
  5. 5
    Pick a compression
    Snappy for speed, Zstd for a smaller size. Test on your own data.
  6. 6
    Select only the columns you need
    Avoid SELECT * on wide tables. It defeats column pruning.
  7. 7
    Compact small files regularly
    Streaming and frequent loads create many small files. Merge them with a scheduled job or table format maintenance.
💡A folder layout you will see often
sales/year=2026/month=01/part-0001.parquet. Filtering on year and month means whole folders are never listed or read.
⚠️Files are immutable
You do not update a row inside a Parquet file. You write new files and replace old ones. Table formats (Delta, Iceberg, Hudi) add updates and deletes on top.

08Key Terms to Know

TermMeaning in easy words
ParquetAn open columnar file format for analytics data
Row groupA horizontal slice of rows inside the file, holding all columns for those rows
Column chunkAll the values of one column within one row group
PageThe small unit inside a chunk that is encoded and compressed
FooterMetadata at the end of the file: schema, offsets, statistics
StatisticsMin, max and null counts for each chunk
Column pruningReading only the columns a query needs
Predicate pushdownApplying filters at the file level, using statistics, to skip data
Dictionary encodingReplacing repeated values with short codes
Run-length encodingStoring a value once with a repeat count
PartitioningSplitting data into folders by a column value
Small files problemMany tiny files cause slow listing and low read efficiency
Table formatA layer (Delta, Iceberg, Hudi) that tracks Parquet files to add transactions

09Pros, Cons and Trade-offs

✅ Pros
  • Reads only the needed columns and row groups
  • Small files thanks to encoding and compression
  • Typed, self-describing schema in the file
  • Supported by almost every analytics tool
  • Fast, cheap scans on object storage
⚠️ Cons
  • Poor for fetching one full row by key
  • Files are immutable: updates mean rewriting
  • Many small files hurt performance
  • Not human readable
  • Schema changes are limited (renames and type changes need care)

Trade-offs

ChoiceWe gainWe lose
Bigger row groupsBetter compression and fewer chunksMore memory to write, coarser skipping
Smaller row groupsFiner skippingMore metadata, worse compression
Zstd instead of SnappySmaller filesMore CPU to write and read
Sorted dataTight min/max, more skippedExtra sort work on write
Fine partitionsSkip more foldersMore files and the small files problem

10Common Problems and Mistakes

Common mistakes

  1. Too many small files. Streaming jobs that write a file every few seconds leave millions of tiny files. Compact them.
  2. Over-partitioning. Partitioning by user or minute makes one tiny file per folder.
  3. SELECT * on wide tables. It reads every column and throws away the main benefit.
  4. Unsorted data with a filter. If every row group holds a mix of values, min and max cover the whole range and nothing is skipped.
  5. Treating Parquet as a database. Row-by-row updates and key lookups are slow. Use a database or a table format.
  6. Changing column types freely. Files written with different types for the same column break readers. Plan schema changes.
  7. Mixed schemas in one folder. Engines may merge them in surprising ways or fail.

Things to watch

🧮Nested data
Parquet stores nested fields as columns too. Reading one deep field is cheap, but very deep nesting is harder to tune.
🕒Timestamp types
Different tools write time in different units and time zones. Test round trips.
🔤Column renames
Many readers match by name, so a rename can look like a new empty column.
📏Row group size vs memory
Huge row groups need a lot of memory while writing.

11Real-World Examples

🐦Twitter and Cloudera
Created Parquet in 2013, inspired by Google’s Dremel paper on columnar nested data.
⚡Spark
Parquet is the default format for DataFrames, with pruning and pushdown built in.
🔍Amazon Athena
Charges by bytes scanned. Converting CSV to Parquet often cuts cost and time sharply.
🧊Iceberg, Delta, Hudi
Table formats that keep a log of Parquet files to add transactions and time travel.
🦆DuckDB and pandas
Read Parquet on a laptop, often straight from cloud storage.
🏗️ORC at Facebook
ORC is the similar columnar format favoured in the Hive world.
📝Note
The savings depend on the data and the query. Wide tables, repeated values and narrow queries see the biggest gains.
Mini case: a slow, costly query
📄CSV, 500 GBscan everything
→↓convert to Parquet, sort by date
🧱Parquet, ~100 GBread 3 columns, skip old dates
→↓result
💰A few GB scannedfaster and cheaper
Same data, same question, stored differently.

12Related Topics to Read Next

Data Formats→

Where Parquet sits next to JSON, Avro and Protobuf.

Columnar Databases→

The same column idea, inside a database.

Data Lakes→

Where Parquet files usually live.

Data Lakehouse→

Table formats add transactions on top of Parquet.

Spark and Hadoop→

The engine that reads and writes Parquet most.

Compression and Deduplication→

How encoding and compression shrink the files.

Object Storage→

Where the files are kept, and why listing many files is slow.

Bitmaps and Roaring Bitmaps→

Another way engines store and combine sets compactly.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • ✔Columnar: values of one column stored together.
  • ✔Layout: file → row groups → column chunks → pages, then the footer.
  • ✔Footer: schema, locations and min/max, read first.
  • ✔Two big wins: column pruning and row-group skipping.
  • ✔Small and fast: dictionary, run-length, delta encoding, then Snappy or Zstd.
  • ✔Avoid: tiny files, over-partitioning, SELECT *, row-by-row updates.
  • ✔Updates? Use Delta, Iceberg or Hudi on top.
  • ✔One line: “Store by column, keep notes on each chunk, and read only what can matter.”
← Previous
Workflow Orchestration (Airflow)
Next →
Data Governance and Feature Stores