liveBook · Manning

Position delete

As explained in Architecting an Apache Iceberg Lakehouse

A position delete is an Iceberg delete record that identifies a row by its position within a data file.

A position delete is an Iceberg delete record that identifies a row by its physical position within a data file. In merge-on-read, the delete file is applied during queries, so affected data files do not need immediate rewriting. This reduces write amplification and can improve ingestion throughput, but it adds read-time reconciliation and requires the writer to know exactly which rows to remove. section 6.3.1 section 10.1.4

Position deletes shape table architecture and operations in several ways:

  • Resolve deletes efficiently at read time because engines can match file and row position directly. section 6.3.1 section 10.1.4
  • Require precise row identification, making them less flexible than equality deletes for some streaming and CDC-style ingestion pipelines. section 6.3.1
  • Accumulate delete-file work that can slow reads as queries merge base files with multiple layers of deletes. section 10.1.4
  • Still leave deleted rows physically present until compaction, snapshot expiration, and orphan cleanup complete the deletion lifecycle. section 11.2.5
  • Depend on engine capabilities: Apache Spark supports position deletes, while Apache Flink supports equality deletes. section 6.3.1

Merge-on-read deletion

A pipeline records the locations of rows to remove in a position-delete file instead of rewriting the entire data file. Queries read the base file and exclude those positions. Later compaction rewrites data without the deleted rows, while snapshot expiration and orphan cleanup remove no-longer-referenced files. section 6.3.1 section 11.2.5

Figure 6.9 When using delete files, updated and deleted records in existing data files are ignored, while new data files containing only the updated records are written.

Shows how delete files cause old records to be ignored while new data files hold updated records. section 6.3.1

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Explains file-and-position matching, read-time filtering, compaction tradeoffs, and engine support.
Examples
Uses row-level corrections, data subject erasure, downstream synchronization, and high-frequency updates as operational contexts.
What it assumes
Assumes data-file and query concepts while contrasting merge-on-read with copy-on-write and equality deletes.
What you can do after
Evaluate position deletes by weighing exact-row knowledge, ingestion throughput, read performance, and compaction requirements.
How it connects
Connects merge-on-read, equality deletes, copy-on-write, delete files, compaction, snapshots, and CDC.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.