BigData / Apache Iceberg Interview questions
What is the role of sequence numbers in Iceberg snapshots?
Every snapshot in Iceberg carries a monotonically increasing sequence number, distinct from its snapshot ID, used specifically to determine the relative ordering of data and delete files — which matters most when reconciling merge-on-read delete files against the data files they're meant to apply to.
Because a delete file needs to apply only to data written before it (not to data written afterward, which the deleting operation couldn't have known about), sequence numbers give Iceberg an unambiguous way to determine "was this data file written before or after this delete file" even when snapshot IDs alone, or timestamps alone (which can have clock skew issues across distributed writers), wouldn't reliably answer that question.
This ordering guarantee is what makes merge-on-read correctness possible at all: at read time, the engine uses sequence numbers to correctly apply only the delete files that logically postdate a given data file, ensuring a row isn't incorrectly treated as deleted by a delete file that was actually recorded before that row's data file even existed.
More Related questions...