DATA ENGINEERING · QUESTION 96
When would you use Parquet instead of CSV?
On this page
CSV is a simple text format that is easy to inspect and exchange, but it repeats field names only through external conventions and lacks strong typed column storage. Parquet is a compressed columnar format with schema metadata, making it efficient for analytical queries that read selected columns. Choose based on interoperability, query patterns, tooling, and operational needs.
LET'S MAKE IT SIMPLE
First, the idea in plain English
CSV stores rows as text, which is convenient for people and simple tools. Parquet organizes data by columns and records types, so an analytical engine can read only columns needed by a query and compress similar values. The format does not replace good schema and data-quality practices.
A USEFUL COMPARISON
Picture it this way
CSV is like a spreadsheet printed row by row; Parquet is like filing each column’s values together with a catalog of their types. If a report needs only two columns from millions of rows, column storage can avoid reading unrelated fields.
FOLLOW THE JOURNEY
Row-oriented text and columnar analytical storage differ
Compare how each format stores records and supports analytical reads.
This simplified visual highlights the main relationships. In practice, the exact design depends on the requirements; Actual performance depends on codecs and engine support.
CSV stores text fields together by row, while Parquet stores column chunks with typed metadata and compression for selective analytical scans.
How to read this visual
This simplified visual highlights the main relationships. In practice, the exact design depends on the requirements; Actual performance depends on codecs and engine support.
UNDER THE HOOD
How it works, step by step
Match format to consumer
Identify whether people exchange files or engines scan analytical subsets.
Why it matters: Interoperability and access patterns guide the choice.
Write schema-aware data
Preserve types, nulls, and schema evolution requirements.
Why it matters: Text parsing can otherwise infer ambiguous values.
Measure storage and reads
Compare compression, columns scanned, and end-to-end query time.
Why it matters: Actual performance depends on codecs and engine support.
OUTSIDE THE TEXTBOOK
A practical example
A team shares a small daily export with a vendor that expects a spreadsheet, so CSV may be simplest. Its large internal event table is stored as Parquet because dashboards repeatedly select a few typed columns from time partitions.
GO A LITTLE DEEPER
Technical details that matter
- Parquet is columnar and supports compression and encoding schemes suited to analytical scans.
- CSV needs conventions for quoting, delimiters, nulls, and types; different parsers can interpret values differently.
- File format is separate from table format and transaction guarantees.
MAKE A GOOD CHOICE
When is this useful?
- CSV for simple interchange and human inspection.
- Parquet for typed, compressed analytical datasets.
- Interoperable data lakes with column-selective query engines.
Avro or JSON can suit row-oriented event exchange and schema evolution needs; choose based on consumers and workload.
WATCH OUT FOR
Common misunderstandings
- Assuming Parquet alone provides transactions or table management.
- Treating CSV values as reliably typed without a schema.
- Choosing format from file size alone instead of query behavior.
REAL-WORLD TRADE-OFFS
Limitations and failure cases
- Parquet is less convenient for manual editing and row-by-row updates.
- CSV parsing rules can be ambiguous across tools.
- Compression and performance vary with data shape and codec.
WHAT TO REMEMBER
Key takeaways
- 1CSV is simple text; Parquet is typed columnar storage.
- 2Columnar layout helps analytical scans of selected fields.
- 3A format does not replace schema, table, or quality controls.
PRACTICE THE FOLLOW-UP
What might an interviewer ask next?
Why is Parquet efficient for analytics?
It stores column chunks and metadata so engines can skip unused columns and apply compression suited to similar values.
Does Parquet guarantee schema evolution?
It stores schema information, but compatibility across files and readers still depends on table conventions and tooling.
SAY IT OUT LOUD
How to explain this in an interview
“CSV is convenient for simple exchange and manual inspection, while Parquet is a typed columnar format that often suits large analytical scans and compression. I would choose based on consumers and query patterns. I would also distinguish the file format from table transactions and schema-governance capabilities.”
Connect this question to the roadmap topic it supports.