Parquet versus ORC versus Delta for Spark tables?
Summary
- Apache Parquet and Apache ORC are columnar file formats. Delta Lake is a table format that stores data in versioned Parquet files plus a transaction log, so choosing Delta means choosing Parquet underneath with transactions on top.
- Spark reads and writes Parquet and ORC natively. Parquet is Spark's default data source (
spark.sql.sources.defaultisparquet), and ORC uses Spark's native implementation with a vectorized reader by default. - In current Spark releases the default compression codec is
snappyfor Parquet andzstdfor ORC. In Spark, both support schema merging (off by default) and, since Spark 3.2, columnar encryption, and both file formats define bloom filters. - Delta Lake adds ACID transactions, time travel with
versionAsOf,MERGE,UPDATEandDELETE, schema enforcement on write, and tables that work as both a streaming source and a sink. CONVERT TO DELTAturns an existing Parquet table into a Delta table in place, without rewriting its data files.
Parquet versus ORC versus Delta for Spark tables?
These aren't three versions of the same thing. Apache Parquet and Apache ORC are columnar file formats: each one defines how a single file stores typed, compressed columns. Delta Lake is a table format: it keeps data in versioned Parquet files and adds a transaction log that records every commit, which is where ACID transactions, time travel and row-level changes come from. So the decision has two parts: the file format, and whether your tables need a transactional layer. For Spark tables that change over time or have several writers, use Delta Lake. For immutable files that many tools read directly, Parquet is Spark's default and ORC is a fully supported alternative.
Aspect by aspect
| Aspect | Apache Parquet | Apache ORC | Delta Lake |
|---|---|---|---|
| What it is | Open source, column-oriented data file format | Self-describing, type-aware columnar file format | Open source storage layer over Parquet files |
| Layout | Row groups made of column chunks, which are divided into pages; file metadata written after the data | Independent stripes; file and stripe statistics in the file footer | Parquet data files plus a transaction log in the _delta_log directory |
| Statistics and indexes | Footer metadata; Spark filter pushdown on by default | File, stripe and row-level indexes; Spark filter pushdown on by default | Per-file statistics used for data skipping |
| Default codec in Spark | snappy |
zstd |
Data files are Parquet |
| Schema changes | mergeSchema merges compatible file schemas on read, off by default |
mergeSchema on read, off by default |
Schema enforcement on write; the mergeSchema write option evolves the schema |
| Transactions | Not part of the format | Not part of the file; Apache Hive builds ACID tables from ORC base and delta files | ACID transactions, so readers never see inconsistent data |
| Row-level changes | Overwrite files or partitions | Overwrite files or partitions | MERGE, UPDATE and DELETE |
| History | None | None | Time travel with versionAsOf or timestampAsOf |
| Streaming | File source and file sink | File source and file sink | Source and sink, with exactly-once writes through the log |
How Spark handles each one
Parquet is what Spark writes when you don't name a format. The spark.sql.parquet.compression.codec setting defaults to snappy and accepts values such as zstd, gzip and lz4. Schema merging has been off by default since Spark 1.5.0; turn it on per read with mergeSchema. Since Spark 3.2, Parquet tables support columnar encryption with Apache Parquet 1.12 and above.
ORC has two implementations in Spark, native and hive, selected by spark.sql.orc.impl. The native one follows Spark's data source behavior and has been the default, with a vectorized reader, since Spark 2.3. You can set bloom filters and dictionary encoding per column, and Spark 3.2 added Zstandard compression and columnar encryption with Apache ORC 1.6. ORC supports the complete set of Hive types, including unions, which makes it a natural fit for data that already lives in Hive.
Delta Lake needs the delta-spark package and two session settings, spark.sql.extensions and spark.sql.catalog.spark_catalog, as shown in the Delta Lake quick start. After that, USING delta behaves like any other data source.
CREATE TABLE events_parquet (id BIGINT, ts TIMESTAMP, kind STRING) USING parquet;
CREATE TABLE events_orc (id BIGINT, ts TIMESTAMP, kind STRING) USING orc
OPTIONS (compression 'zstd', orc.bloom.filter.columns 'kind');
CREATE TABLE events_delta (id BIGINT, ts TIMESTAMP, kind STRING) USING delta;
CONVERT TO DELTA parquet.`/lake/legacy_events`;
CONVERT TO DELTA lists the files in a Parquet directory, writes a transaction log that tracks them and infers the schema from the Parquet footers, without rewriting data. For a partitioned Parquet table, add a PARTITIONED BY clause with the partition column types. ORC data needs a rewrite: read it with spark.read.orc() and write it with format("delta").
How to choose
- Tables that change. Updates, deletes, merges, concurrent writers or audit history point to Delta Lake.
- Files that other tools read directly. Plain Parquet or ORC files are readable by any engine that understands the format, with no table layer to coordinate.
- Streaming into tables. A Delta table works as a streaming sink with exactly-once guarantees even while other streams or batch jobs write to it.
How Databricks approaches table formats
Databricks uses Delta Lake for all tables by default, and Unity Catalog governs them as managed or external tables. For managed tables, predictive optimization runs OPTIMIZE, VACUUM and ANALYZE automatically. Auto Loader ingests Parquet and ORC files, among other formats. Iceberg clients can use Unity Catalog's Iceberg REST catalog endpoint to read managed Iceberg tables and Delta tables with Iceberg reads (UniForm) enabled.
FAQs
Does Delta Lake replace Parquet?
No. Delta Lake stores its data in Parquet files and adds a transaction log next to them, so the file format stays the same.
Can Delta Lake store data in ORC?
No. The Delta Lake docs state that Delta uses versioned Parquet files to store data, and in-place conversion is documented for Parquet tables and Parquet-backed Iceberg tables only.
Which compression codec should I pick?
Start with Spark's defaults, snappy for Parquet and zstd for ORC, and override them per table with the compression option.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.