Skip to content

Add delete, update, and merge-insert (UPSERT) operations#26

Open
beinan wants to merge 3 commits into
daft-engine:mainfrom
beinan:beinanwang/aicd-159-support-delete-update-and-merge-insert-upsert-operations
Open

Add delete, update, and merge-insert (UPSERT) operations#26
beinan wants to merge 3 commits into
daft-engine:mainfrom
beinan:beinanwang/aicd-159-support-delete-update-and-merge-insert-upsert-operations

Conversation

@beinan

@beinan beinan commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add daft_lance.delete(uri, predicate) — delete rows matching a SQL string or PyArrow expression
  • Add daft_lance.update(uri, updates, where=) — update columns using SQL expressions with optional filter
  • Add daft_lance.merge_insert(df, uri, on=) — UPSERT from a Daft DataFrame with full MergeInsertBuilder support (update_all, delete, insert_all, conditional updates, composite keys)

All three follow existing patterns using construct_lance_dataset() and support io_config, version, conflict retries, and storage_options.

Closes AICD-159

Test plan

  • 15 new tests covering all three APIs (delete, update, merge_insert)
  • Edge cases: no-match predicates, delete-all, composite keys, conditional updates, delete-matched, delete-not-matched-by-source
  • Full existing test suite passes (293 passed, 0 failures)

🤖 Generated with Claude Code

Beinan Wang added 2 commits June 7, 2026 23:03
Expose Lance's native delete/update/merge_insert operations through
daft-lance. All three follow existing patterns using
construct_lance_dataset() and support io_config, version, conflict
retries, and storage_options.

Co-Authored-By: Beinan Wang <beinanwang@microsoft.com>
Co-Authored-By: Beinan Wang <beinanwang@microsoft.com>
@beinan beinan marked this pull request as ready for review June 8, 2026 06:07
Co-Authored-By: Beinan Wang <beinanwang@microsoft.com>
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