Arman Pouyaei Start a conversation
Lesson 14  ·  Oct 21, 2026
Data Engineering Fundamentals

Your table is a folder of files: Parquet

Data lakes, lesson one — and a change of scenery: we’re leaving the warehouse. A data warehouse keeps your rows inside a managed database. A data lake is far simpler: it is just files — usually Parquet files — sitting on object storage (S3, GCS). A “table” in a lake is really a folder of files. Today’s idea: Parquet, the default file format, stores data column by column instead of row by row, so a query that only needs one column can skip everything else.

The code

import pandas as pd

df = pd.DataFrame({
    "station_id": [1, 2, 3],
    "temp_c":     [18.4, 21.0, 16.2],
    "humidity":   [72, 55, 81],
    "lat":        [40.7, 41.1, 39.9],
    "lon":        [-74.0, -73.9, -75.1],
})

# write to the lake — one line
df.to_parquet("s3://storm-lake/readings.parquet")

# later: read back ONLY the columns you need
hot = pd.read_parquet("s3://storm-lake/readings.parquet",
                      columns=["station_id", "temp_c"])

The magic line is the last one. With CSV, pandas would have to parse all five columns to give you two. With Parquet, columns=[...] triggers column pruning: the humidity, lat, and lon chunks are never touched on disk — only the two columns you asked for are read.

In practice

CSV stores row by row; Parquet stores column by column, and everything else follows from that. Queries read only the columns they name (5–10× smaller files, 10–100× faster scans than CSV on wide tables). Values of the same type sitting together compress much better (Snappy, Zstd). The file carries a typed schema — no more “is this a string or a float?” guessing. And each chunk keeps min/max statistics, so engines can skip whole blocks that can’t match your filter.

This connects straight to your world: Parquet is the lingua franca of your stack. It is the default file format PySpark writes, and DuckDB reads it directly with SELECT temp_c FROM read_parquet('readings.parquet') — SQL straight over files, no loading step. That folder-of-files idea is also the seed of everything coming next in this arc: partitioning (folders within folders) and table formats like Delta Lake and Iceberg (folders + a metadata log).

Python bridge: think of df.to_parquet() as a smarter to_csv() — typed, compressed, and queryable by any engine. And read_parquet(columns=[...]) is like doing df[["station_id", "temp_c"]] before the data even leaves disk — you never pay to load what you won’t use.

Further reading

What Is Parquet? Columnar File Format vs CSV, Avro & ORC — MotherDuck (a short, visual, beginner-friendly rundown — including DuckDB benchmark numbers on a real NYC taxi dataset)

Try it

Practice question: your pipeline lands hourly storm readings (station_id, temp_c, humidity, lat, lon) into the lake, and most downstream jobs only need station_id + temp_c. Write the two pandas lines: (1) save the DataFrame as Parquet to s3://storm-lake/readings.parquet, and (2) read back only station_id and temp_c. Bonus: in one sentence, what does the read skip?

Show answer
df.to_parquet("s3://storm-lake/readings.parquet")

hot = pd.read_parquet("s3://storm-lake/readings.parquet",
                      columns=["station_id", "temp_c"])

Result: the read skips the humidity, lat, and lon column chunks on disk — column pruning. The job loads two columns instead of five, which is exactly why Parquet scans run 10–100× faster than CSV on wide tables.

← All posts