Parquet versus CSV for analytical data lakes
columnar versus row storage trade-offs.
Parquet stores by column enabling projection pushdown, compression, and predicate skipping; CSV is row-based, untyped, and slow to scan.
Why the comparison matters
Storage format silently determines query cost and speed in a data lake, where compute is often billed by bytes scanned. Choosing CSV for analytics can multiply both cost and runtime.
The full answer
Parquet is a columnar format, meaning values of one column are stored together rather than whole rows. Analytical queries typically touch a few columns out of many, so Parquet reads only those columns, projection pushdown, instead of scanning every byte as CSV requires. Because a column holds homogeneous values, Parquet compresses far better using encodings like dictionary and run-length plus a codec like Snappy, shrinking storage and bytes scanned. Parquet embeds a schema with explicit types, so there is no fragile type inference as with text CSV. It also stores per-row-group statistics such as min and max, letting engines skip entire row groups that cannot match a filter, predicate pushdown. CSV by contrast is row-oriented, plain text, untyped, usually uncompressed, and must be parsed and fully scanned, making it slow and expensive for large analytical workloads, though it remains human-readable and universally supported.
Trade-offs and caveats
CSV is simpler for tiny files, debugging, and interchange. Parquet is harder to inspect by eye and overkill for small data. Columnar layout does not help single-row point lookups or frequent full-row writes.
When it matters
Use Parquet for large analytical tables queried by engines like Spark, Athena, or BigQuery external tables, where scan cost dominates.
A concrete example
A hundred-column events table is queried for two columns filtered by date. In CSV the engine reads the entire file. In Parquet it reads only the two columns and skips row groups outside the date range using min/max stats, scanning a fraction of the bytes and finishing far faster and cheaper.
Interview question
Why does a query selecting 2 of 100 columns run far cheaper on Parquet than CSV in a data lake?
- a.CSV automatically compresses better than Parquet
- b.Parquet is columnar, so only the two needed columns are scanned rather than every byteCorrect
- c.Parquet caches the entire table in memory by default
- d.Parquet stores rows together so fewer rows are read
Why? this is the answer
Columnar layout lets the engine read just the requested columns, slashing bytes scanned, unlike row-based CSV which reads everything. Parquet stores by column, and CSV is typically uncompressed.
Just read this? Test yourself on what you have been reading.
- #parquet
- #csv
- #columnar-storage
- #data-lake
- #query-performance
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles