Parquet plus a ledger: open table formats
Yesterday’s “table” was a folder of Parquet files. It worked — until you needed to fix a bad row. A folder of files is append-only: you can’t update a reading, two writers landing at once can corrupt the layout, and there’s no undo. Open table formats — Delta Lake, Apache Iceberg, and Apache Hudi — keep the exact same Parquet files but add a metadata layer on top: a ledger that records every change as a transaction. That ledger is what turns the folder into a table that behaves like a database.
The code
MERGE INTO storm_readings AS t USING new_readings AS s ON t.station_id = s.station_id AND t.measured_at = s.measured_at WHEN MATCHED THEN UPDATE SET t.temp_c = s.temp_c WHEN NOT MATCHED THEN INSERT *;
This is Delta Lake’s MERGE INTO — the upsert every table format supports. The ON clause matches each incoming row against the table on the composite key (station_id, measured_at). A corrected reading that matches an existing row overwrites just that row’s temp_c; a genuinely new row gets inserted. No rewriting the whole folder.
In practice
That ledger buys four things plain folders can’t do. Upserts, updates, and deletes: row-level changes on immutable Parquet — fix bad storm-sensor readings in place instead of rewriting terabytes. ACID transactions: concurrent writers append to the same log atomically, so hourly sensor batches landing at once can’t corrupt the table — your Lesson 13 knowledge, now working on the lake. Time travel: every change is a new version, so you can query the table exactly as it looked last Tuesday, before a bad batch landed. Compaction: the format quietly merges yesterday’s thousands of tiny files into big ones — the cure for the Lesson 15 small-files problem.
Which format do you actually need to know? Delta Lake is the Spark-native one — tightest with PySpark, and it invented the _delta_log idea. Apache Iceberg is the engine-neutral one: Spark, Trino, DuckDB, and Flink all read the same table without copying, which is why it’s become the default for multi-engine teams. Hudi leans toward streaming and high-frequency upserts. In your world: hourly sensor or satellite batches land as tiny files, the table compacts them automatically, MERGE folds in corrected observations, and every engine on the team reads the same table.
Python bridge: think of the transaction log as git for your data folder. Every MERGE or append is a commit, time travel is git checkout <version>, and the Parquet files are the working tree. You can’t get any of this from plain pandas + folders — that gap is exactly why these formats exist.
Further reading
What Is Apache Iceberg? — Datus blog (a beginner-friendly intro to table formats with an Iceberg vs Delta Lake comparison)
Try it
Practice question: you have a Delta table storm_readings and a corrections table with fixed temp_c values for some station_id/measured_at pairs. Write a MERGE INTO that updates temp_c on the rows that match — but ignores rows that don’t match (no inserting). Which single clause from today’s example do you drop?
Show answer
MERGE INTO storm_readings AS t USING corrections AS s ON t.station_id = s.station_id AND t.measured_at = s.measured_at WHEN MATCHED THEN UPDATE SET t.temp_c = s.temp_c;
Result: drop the WHEN NOT MATCHED THEN INSERT *; clause. Matched rows get their temp_c corrected; correction rows with no match are simply ignored, and no new stations are added to the table. A corrections-only MERGE is one of the most common shapes in real pipelines.