feat: add table.delta for version-to-version row changes (#5135)

Adds native `Table::delta(from_version, to_version=None)` and Python
sync/async `table.delta(...)` for version-to-version row changes.
`TableDelta` exposes streaming `inserted_rows()`, `updated_rows()`,
`upserted_rows()`, `deleted_row_ids()`, and `list_transactions()`.

Endpoints are resolved once on independent dataset handles.
`to_version=None` uses the table handle's visible snapshot, and the
handle's checkout is not changed. Only versions `>= 1` and tags on the
current branch are accepted; cross-branch tags, reversed ranges, version
0, and missing endpoints are rejected. Equal valid endpoints return
empty readers with the same schemas.

Row-level readers require stable row ids at both endpoints and report
the `storage_options={"new_table_enable_stable_row_ids": "true"}`
creation guidance when they are absent. `list_transactions()` does not
require stable row ids.

Row-level readers also fail closed when the range contains a `Restore`,
or when transaction history cannot prove the range is restore-free,
because restored rows can retain older row-version metadata that the
delta readers omit. The error directs consumers to a full rescan and
reinitializing the checkpoint at the range end version.
`list_transactions()` remains available for readable history. The
Versioning guide includes Python and Rust checkpoint-delta examples with
stable-row-ID setup and this Embedded limitation.

Embedded `branches.diff()` remains a separate API.

Refs OSS-2860
This commit is contained in:
Xuanwo
2026-11-21 06:41:38 +08:00
committed by GitHub
parent baea02eebd
commit 8dc03bd288
14 changed files with 1892 additions and 3 deletions
+4
View File
@@ -428,6 +428,8 @@ code that used the former LanceDB Enterprise-only argument order.
::: lancedb.table.Branches
::: lancedb.table.TableDelta
::: lancedb.RTEWriteSpec
## Functions and Jobs
@@ -1317,6 +1319,8 @@ Table hold your actual data as a collection of records / rows.
::: lancedb.table.AsyncBranches
::: lancedb.table.AsyncTableDelta
## Materialized Views (Asynchronous)
::: lancedb.materialized_view.AsyncMaterializedView