Skip to content

Add table update API for ordered expressions and commit result - #81

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/c-update-builder-wrapper
Nov 21, 2026
Merged

Xuanwo merged 3 commits into
mainfrom
xuanwo/c-update-builder-wrapper

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

The Go migration needs one native update operation that carries column/expression assignments, an optional SQL predicate, and the affected rows and committed version in a single SDK call. Both the published literal-map Update and the newer UpdateExpr path can use it; literal conversion stays in Go.

This adds lancedb_table_update and LanceDBUpdateResult without changing existing header signatures or ABI. Assignments are paired by index and passed in caller order, but that is not an evaluation order: every expression reads the row as it was before the update, so a=b, b=a swaps the original values. A NULL or empty predicate updates every row. Invalid structural input returns LANCEDB_INVALID_ARGUMENT, while SQL expression errors keep their SDK diagnostics. The result comes from the SDK's UpdateResult; on a legacy remote empty response, zero rows or version means unknown.

The new public C ABI regression swaps two distinct int32 values and reads them back, which verifies the Lance 15 evaluation semantics now provided by #78 on main. It also covers filtered mutation, all-row multi-assignment, invalid expression diagnostics, invalid input, and the returned version.

Expose the SDK UpdateBuilder through lancedb_table_update: ordered
column/expression assignments, an optional SQL predicate, and the
committed row count and version in one call. This gives the Go update
paths one native operation for both literal-map and expression updates.

The new result struct and entry point are additive; existing symbols and
layouts stay unchanged. Empty assignments, null entries, empty column
names and invalid UTF-8 are rejected as invalid arguments, while SQL
errors keep the SDK diagnostics.
Document that column/expression input order is not evaluation order and
that every assignment reads the row before the update. Add a public C ABI
regression that swaps two distinct int32 values and reads them back, which
only produces (2, 1) when the SDK evaluates all expressions against the
original row.

Also document that a legacy remote empty update response can report zero
rows and version, so zero means unknown there.
@Xuanwo
Xuanwo merged commit 5fb4330 into main Nov 21, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant