diff --git a/mkdocs/docs/api.md b/mkdocs/docs/api.md index 7eed8faa51..093623eac9 100644 --- a/mkdocs/docs/api.md +++ b/mkdocs/docs/api.md @@ -2341,6 +2341,28 @@ DataFrame() +---+---+ ``` +## Incremental append scan + +`incremental_append_scan()` reads only the rows appended to a table between two snapshots: + +```python +tbl.incremental_append_scan( + from_snapshot_id_exclusive=from_snapshot_id, + to_snapshot_id_inclusive=to_snapshot_id, +).to_arrow() +``` + +Both bounds are optional. Without a start, the scan reads from the beginning of the table's history, and without an end, up to the current snapshot. The start must be an earlier snapshot in the end snapshot's history, or a `ValueError` is raised. + +It takes the same filtering and projection arguments, and has the same output methods, as [`scan()`](#query-the-data). + + + +!!! warning "Only appends are read" + Only `append` snapshots, such as those committed by `append()` and `add_files()`, are read. Other snapshots are skipped, including any rows they add. Deletes aren't reported, so a row that was deleted after it was appended is still returned, and after an `upsert()` an updated row can be returned with both its old and its new values. + + + ## Type mapping ### PyArrow diff --git a/pyiceberg/table/__init__.py b/pyiceberg/table/__init__.py index 1c6d4c3a33..d61eb9c8d9 100644 --- a/pyiceberg/table/__init__.py +++ b/pyiceberg/table/__init__.py @@ -1592,6 +1592,7 @@ def incremental_append_scan( The incremental append scan returns the rows added by append snapshots in a snapshot range that match the provided row_filter, projected onto the table's current schema. + Non-append snapshots in the range are skipped, so this is not a changelog scan. Args: from_snapshot_id_exclusive: