Skip to content

Conversation

@ethan-tyler
Copy link
Owner

Which issue does this PR close?

  • Closes #.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Add complete DELETE and UPDATE support to MemTable as a reference
implementation for the TableProvider DML hooks.

Implementation:
- `delete_from()`: Evaluate filter predicates, remove matching rows
- `update()`: Evaluate filters, apply SET expressions to matching rows
- `DmlResultExec`: ExecutionPlan returning affected row count
- Correct SQL NULL semantics (NULL predicates preserve rows)

Tests (812 lines):
- DELETE: basic, all rows, predicates (=, >, AND, OR, LIKE, BETWEEN,
  IN, NOT IN, IS NULL, IS NOT NULL), NULL handling, functions, types
- UPDATE: basic, SET expressions, multi-column, CASE, functions,
  column references, NULL handling, error cases

All sqllogictest tests pass:
  cargo test --test sqllogictests -- dml_delete dml_update
Now that MemTable supports DELETE and UPDATE, the existing EXPLAIN
tests produce physical plans instead of "not implemented" errors.
Updated expected output to reflect the new DmlResultExec execution.
@ethan-tyler ethan-tyler merged commit a59d9a6 into main Dec 7, 2025
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.

2 participants