Lakehouse Tables with Apache Iceberg

Use Apache Iceberg, the engine-neutral open table format, for snapshots, hidden partitioning, partition evolution and multi-engine access.

Advanced · about 6 hours · difficulty 4/5

Learn first: PySpark DataFrames, How Cloud Data Warehouses Work

Apache Iceberg solves the same problem as Delta Lake (reliable tables on object storage) with a strong focus on engine neutrality. Spark, Trino, Flink, Snowflake, BigQuery, Athena and DuckDB can all read and often write Iceberg tables, which is why it has become the standard many vendors support.

How it works

  • A catalog (Hive Metastore, AWS Glue, REST catalog, Nessie, Polaris) points to the table's current metadata file.
  • Metadata lists snapshots; each snapshot points to manifest lists and manifests that track data files with column statistics.
  • Commits swap the metadata pointer atomically.

Standout features

  • Hidden partitioning: define partitions as transforms (days(order_ts), bucket(16, user_id)); queries filter on the original column and still prune.
  • Partition evolution: change partitioning later without rewriting old data.
  • Schema evolution tracked by column IDs, so renames and reorders are safe.
  • Time travel and rollback using snapshots.
  • Row-level deletes with copy-on-write or merge-on-read.

Maintenance

Expire old snapshots, rewrite (compact) small data files and remove orphan files, just like Delta's OPTIMIZE and VACUUM.

Delta or Iceberg?

Both are solid. Delta is the natural default on Databricks; Iceberg is popular on AWS (Athena, Glue, S3 Tables), Snowflake and multi-engine platforms. Learn one well and the other in an afternoon.

Pitfalls

  • Forgetting snapshot expiry and letting metadata and storage grow forever.
  • Mixing catalogs so different engines see different versions of the same table.

You are ready to move on when you can create an Iceberg table with hidden partitioning, query it from two engines (for example Spark and DuckDB or Trino), and evolve its partition spec.

Key concepts

  • Catalogs and metadata files
  • Snapshots and manifests
  • Hidden partitioning
  • Partition evolution
  • Copy-on-write vs merge-on-read
  • Snapshot expiry and compaction
  • Multi-engine access

Other options for this step

  • Lakehouse Tables with Delta Lake: Add ACID transactions, schema enforcement, time travel and MERGE to files in object storage with Delta Lake, the table format behind Databricks.

Mini project

Run Spark with an Iceberg catalog in Docker (or use AWS Athena with Glue). Create a table partitioned by days(order_ts), load data, change the partitioning to hours, add a column, and roll back to an earlier snapshot.

Check yourself

What does hidden partitioning protect users from, compared with a Hive-style dt column they must filter on manually?

Free resources