Skip to the page

Cloud data platforms · core

File formats and why Parquet is fast

Choose the format by use: Parquet for analytics, Avro or Protobuf for messages, CSV only at the edges. Parquet is fast because queries read fewer columns and skip row groups using statistics.

The notes

What you must know

  • Parquet: columnar, compressed and encoded per column, with min and max statistics. It is the default for analytics and for Delta, Iceberg and Hudi tables. ORC is similar, from the Hive world.
  • Avro: row-based with the schema alongside and clear evolution rules, used for streaming with a schema registry. Protobuf is similar, often between services.
  • CSV is readable but untyped, with delimiter, quoting, encoding and date traps. Gzip-compressed CSV cannot be split across tasks. For partner files agree a spec (UTF-8, header, delimiter, date format, a row-count trailer), validate on arrival and convert to Parquet.
  • JSON is flexible but big and slow to parse. Land it, then parse into typed columns, or keep semi-structured parts in a VARIANT column (Spark 4.0, Delta, Snowflake) or BigQuery's JSON type.
  • Compression: snappy is fast (Spark's Parquet default); zstd compresses better at similar speed; gzip is slow.
  • Parquet layout: row groups (often about 128 MB), each with a column chunk per column, split into pages. The footer holds the schema and statistics (min, max, null count, optional bloom filters).
  • Column pruning reads only the needed column chunks. Predicate pushdown skips row groups whose min and max range cannot contain the value, but only if data is sorted or clustered by that column.
  • Encoding: dictionary encoding stores each distinct value once; run-length and bit-packing shrink further. Table formats copy file statistics into metadata so whole files can be skipped. Small files hurt because each costs a footer read and a request.

The red pen

Common traps: mistake → fix

  • Mistake: Parquet is compressed CSV

    Fix: it is columnar with statistics and types.

  • Mistake: CSV, because everyone can open it

    Fix: it is untyped and gzip CSV is not splittable.

  • Mistake: Min and max skipping works on any data

    Fix: on unsorted data every row group spans most values.

Easy to hard

Questions interviewers ask, easy to hard

  1. Pick a file format for raw Kafka events, analyst tables, a partner file and service messages.
  2. Why does a Parquet query read less than the whole file?
  3. Why does sorting data by city help a query for Pune?
  4. Why is gzip CSV a problem in Spark?

Practise

Practise with these questions

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview