TGViewer
Data Apps Design Data Apps Design @data_apps · 2.08K subscribers
Post #178 619
During one of the lessons we’ve been examining popular file formats. How does columnar storage, data encoding, compression algorithms make difference?

File formats comparison: CSV, JSON, Parquet, ORC

Key results

Whenever you need to store your data on S3 / Data Lake / External table choose file format wisely:

– Parquet / ORC are the best options due to efficient data layout, compression, indexing capabilities
– Columnar formats allow for column projection and partition pruning (reading only relevant data!)
– Binary formats enable schema evolution which is very applicable for constantly changing business environment

Inputs

– I used Clickhouse + S3 table engine to compare different file formats
– Single node Clickhouse database was used – s2.small preset: 4 vCPU, 100% vCPU rate, 16 GB RAM
– Source data: TPCH synthetic dataset for 1 year – 18.2M rows, 2GB raw CSV size
– A single query is run at a time to ensure 100% dedicated resources

To perform it yourself you might need Yandex.Cloud account, set up Clickhouse database, generate S3 keys. Source data is available via public S3 link: https://storage.yandexcloud.net/otus-dwh/dbgen/lineorder.tbl.

Comparison measures

1. Time to serialize / deserialize

What time does it take to write data on disk in a particular format?

– Compressed columnar formats ORC, Parquet take leadership here
– It takes x6 times longer to write JSON data on disk compared with columnar formats on average (120 sec. vs 20 sec.)
– The less data you write on disk the less time it takes - no surprise

2. Storage size

What amount of disk space is used to store data?

– Obviously best results show zstd compressed ORC and Parquet formats
– Worst result is uncompressed JSON which is almost 3 times larger than source CSV data (you have to copy schema for every row!)
– Great results for zstd compressed CSV data which is 632MB vs 2GB of uncompressed data

3. Query latency (response time)

How fast can one get query results for a simple analytical query?

3.1. OLAP query including whole dataset (12/12 months)

– Columnar formats outperform text formats because they allow to access only specific columns and there’s no excessive IO
– Compression accounts for lower IO operations thus lower latency

3.2. OLAP query including subset of rows (1/12 months)

– Results for this query are pretty much the same as for the previous one without WHERE condition
– Although columnar formats allow for partition pruning and reading only relevant rows (according to WHERE condition), it is not pushed down
– Clickhouse EXPLAIN command revealed that filter is applied only after the whole result set is returned from S3 😕

See scripts and queries →
Gist File formats comparison: CSV, JSON, Parquet, ORC File formats comparison: CSV, JSON, Parquet, ORC. GitHub Gist: instantly share code, notes, and snippets.
More from @data_apps
  1. Aug 25, 2026🔸 Меня заблокировал Cursor Сообщение: Your Cursor account was closed following an account…
  2. Feb 27, 2026✅ 3 ОФФЕРА, мои мысли и рекомендации по поиску работы в 2026 в Data и IT в целом Салют! Чу…
  3. Feb 6, 2026Эксперимент успешный 😌 Чек-лист: https://gist.github.com/kzzzr/e49b7e0b2af01e4e1dbc57102d…
  4. Feb 6, 2026👀 DataLens: Бесплатная сказка закончилась. Кейс миграции на Superset (Open Source BI) 1 м…
  5. Feb 2, 2026😘 Открываю доступ к закрытым записям цикла Designing Modern Data Apps Всем привет! 🟡 Это…
  6. Jan 22, 2026☄ Открыт к предложениям: Staff Data Engineer / Data Platform Lead За 11+ лет я прошел путь…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →