New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
100MB of data. 40,000 output files.
What you'll have at the end
About one right-sized file per partition folder instead of tens of thousands, with the file count and total size checked before and after.
You need
A Spark job that already writes its result into a directory partitioned by a column with dozens or hundreds of distinct values, whose output folder holds far more files than the data size can explain.
Not covered
Compacting files a lakehouse table format already has sitting on disk, and the steady drip of small files a streaming job's own frequent micro-batches produce: both call for a scheduled compaction job running on a timer, not a one-time write fix.
Checked 25 Aug 2026
Part of the PySpark cookbook