≈ The Lake

The Lake

How a lakehouse actually works, from bytes in an object store to a vectorized scan: the Delta and Iceberg protocols, Parquet, Unity Catalog, Spark internals and the Databricks platform, down to the algorithms, with every claim tied to a spec or a source line.

Start at chapter 1: Warehouses, lakes and the lakehouse → Or jump to the flagship: 10. Delta commit and optimistic concurrency

39 chapters · 39 complete · 0 draft · 0 outlined

From a query to bytes in S3

Every layer a query passes through on its way down. Click one to see what it does and which chapters cover it.

Query engineTable format and catalogFiles and storage

Step through it

Diagrams are simulators: change the inputs and watch the protocol run, step by step.

Check yourself

Every chapter has checkpoint quizzes. Answers feed a spaced-repetition queue on the Review page.

Go to the source

Citations link to PROTOCOL.md, the Iceberg spec, parquet-format and source code, pinned to a commit.

Contents

Where to start. Read 1. Warehouses, lakes, lakehouse first. After that, any of these opens a part of the book:

Each chapter's page shows what it builds on and what it leads to. Read any time: 2. People, papers and releases, 38. How to read the specs, 39. Glossary and bibliography.

Part 4 Delta Lake protocol

A transaction log of JSON actions over Parquet.

  1. 9 The Delta log: actions and replay The _delta_log directory, every action type and its fields, and the reconciliation rules that turn a sequence of commits into a snapshot. complete
  2. 10 Delta commit and optimistic concurrency ★ flagship How a Delta transaction turns into exactly one new version, what happens when two writers race for it, and the precise sequence of conflict checks that decides who has to give up. complete
  3. 11 Checkpoints, sidecars and log compaction How a reader finds a snapshot without replaying every commit: _last_checkpoint, classic, multi-part and V2 (UUID-named) checkpoints, sidecar files, log compaction files and metadata cleanup. complete
  4. 12 Protocol versions and table features How Delta evolves without breaking readers: minReaderVersion and minWriterVersion, table features at reader version 3 and writer version 7, supported vs active features, how a client decides it may read or write, and how the Spark connector drops a feature. complete
  5. 13 Deletion vectors and row tracking Merge-on-read in Delta: the deletion vector descriptor, the Roaring bitmap storage format, inline vs on-disk DVs, how DELETE writes them and scans apply them, and row IDs and row commit versions. complete
  6. 14 Catalog-managed tables and coordinated commits When the catalog, not the filesystem, decides which commit is version v: proposed, staged, inline, ratified and published commits, the three commit options, how readers combine the catalog with a LIST, and what the Spark connector does differently. complete
  7. 15 Change data feed, column mapping and type widening Three features that change what readers must do: cdc files and the change type column, column mapping by name or id, and type widening metadata. Each one separates what the log says from what the Parquet files hold. complete

Part 5 Apache Iceberg spec

A tree of metadata files and a catalog pointer.

  1. 16 The Iceberg metadata tree Iceberg from the root pointer down: the table metadata file, snapshots, the manifest list, manifests and data files, sequence-number inheritance, and how a scan prunes the tree before it reads a byte of data. complete
  2. 17 Iceberg commits and optimistic concurrency How an Iceberg commit works from the inside: building new metadata, the check-and-put in the catalog, the retry loop that re-applies an operation to a newer snapshot, and the validations that decide whether the retried operation is still correct. complete
  3. 18 Hidden partitioning and partition evolution Partition transforms (identity, bucket, truncate, year, month, day, hour, void), why partition values live in manifests and not in paths, how a filter on a source column is projected to partition predicates, and how specs evolve without rewriting data. complete
  4. 19 Schemas, field IDs and sort orders Why Iceberg tracks columns by ID, the schema evolution rules that follow, type promotion and how old statistics are decoded, default values, reading files that have no IDs, and sort orders and how Spark uses them when writing. complete
  5. 20 Row-level deletes: v2 delete files and v3 deletion vectors Merge-on-read in Iceberg: position deletes, equality deletes, the sequence-number scope rules that decide which delete applies to which file, how readers apply them, the v3 move to deletion vectors in Puffin files, compaction, and row lineage. complete
  6. 21 The REST catalog protocol The Iceberg REST catalog spec: configuration, loading a table, credential vending, commits as requirements plus updates, what the server does with them, failures, idempotency keys, multi-table transactions and server-side scan planning. complete

Part 9 Query execution

From SQL text to vectorized scans and shuffles.

  1. 29 The Spark SQL query lifecycle From SQL text to a running plan in Spark 4.0: parsing, analysis with fixed-point rule batches, Catalyst's logical optimizations, size statistics and join selection, EnsureRequirements and whole-stage codegen, and how adaptive query execution re-plans with runtime statistics. complete
  2. 30 DataSource V2 and scan planning for tables How Delta and Iceberg plug into Spark 4.0: the DSv2 read API, where the optimizer pushes filters, Delta's V1 fallback and PrepareDeltaScan, Iceberg's SparkScanBuilder, how files become tasks, and the runtime filters: dynamic partition pruning, Bloom filters and Databricks dynamic file pruning. complete
  3. 31 The vectorized Parquet reader and columnar batches How Spark 4.0 reads Parquet a batch at a time into ColumnVectors: the read loop, decoding definition levels and RLE dictionary ids run by run, lazy dictionary decoding, the on-heap vector layout, how codegen turns batches back into rows, and the Arrow format Spark uses to exchange columnar data. complete
  4. 32 Vectorized execution: from X100 to Photon Why processing vectors of values beats tuple-at-a-time interpretation, how data-centric code generation does the same job differently, what the comparison between them found, and where Spark's whole-stage codegen and Databricks' Photon sit. complete
  5. 33 Shuffle, joins and skew How an exchange hashes rows to reducers and writes map output files, how JoinSelection chooses among broadcast hash, shuffled hash, sort-merge and nested loop joins, and how AQE re-plans joins, coalesces partitions and splits skewed ones at runtime. complete
  6. 34 MERGE, UPDATE and DELETE internals How row-level operations execute on Delta and Iceberg: finding touched files, copy-on-write rewrites, merge-on-read with deletion vectors, and what each does to the read set and conflicts. complete
  7. 35 Streaming reads and writes on table formats Structured Streaming with Delta and Iceberg as sources and sinks: how the Delta source turns the log into offsets, how rate limits split commits, what happens when the source table is updated, and how the checkpoint and transaction identifiers make the sink exactly-once. complete