Apache Beam now offers a native change-data-capture source for Apache Iceberg tables, allowing pipelines to follow inserts, updates, and deletes rather than only appended rows. In streaming mode, the source polls for new table snapshots at a configurable interval and emits changes as commits arrive; it can also read a bounded range of commits in batch. Each emitted row can include metadata identifying its change type and the snapshot that produced it. Updates appear as a before-and-after pair, while inserts and deletes appear as single changes. This supports downstream systems such as search indexes, caches, and table replicas that must reflect corrections and removals as well as new data.
For each snapshot, Beam compares removed and added rows, matching them by primary key, which Iceberg represents through identifier fields on non-null columns. Matching rows form an update pair; unmatched removed or added rows are classified as deletes or inserts. The source filters out unchanged rows that copy-on-write commits remove and re-add when rewriting files, and reports only the commit’s net effect for each key - even if that key changed multiple times within a commit. Because Iceberg’s changelog scan does not yet handle delete files, Beam uses a different scan approach. The feature is available from Beam SDK 2.79.0 in Java, Python, YAML, and Beam SQL, for Iceberg format versions 2 and 3. Users can select where reading begins and ends by snapshot or time.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.