internalsGet Pro

Module 04 · Lesson 6 of 10Pro

Partitioning files by date and key

Level
Intermediate
Topic
Data formats and file storage
Reading time
16 min

When you finish this page you can

  1. Explain how a reader skips whole files from folder names alone, before it opens a single footer.
  2. Choose a partition key from the filters people run and the number of folders each key creates.
  3. Write Hive-style partitioned Parquet with DuckDB’s COPY … PARTITION_BY and read it back with hive_partitioning.
  4. Replace one night’s folder safely when a job reruns.

Builds on 3 lessons

Start with lesson 317 min
  1. Parquet: columnar files for analytics17 min
  2. Compression and encoding: smaller, faster files17 min
  3. Reading and writing CSV, JSON and Parquet in Python14 min

395 files opened for 7 days of clicks

is an online store in India. Every night, Meera, its data engineer, loads about 10 million click events from the store’s database into . The job then writes the night’s clicks to one file, exports/clicks_<night>.parquet. The product and ML teams read these files, and 13 months of them are kept: 395 files.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan