Problem
DeleteBuilder::execute() (src/dataset/write/delete.rs:136) couples "compute deletion vector / rewrite fragments" with "advance HEAD via manifest commit" as a single operation. There is no public API to stage a delete (compute the DeleteData without advancing HEAD) and commit it later via CommitBuilder.
InsertBuilder::execute_uncommitted (src/dataset/write/insert.rs) and MergeInsertBuilder::execute_uncommitted both expose a public stage-then-commit shape that returns a Transaction for the caller to commit via CommitBuilder::execute.
The two-phase shape is already implemented internally for deletes. DeleteJob (private struct DeleteJob at src/dataset/write/delete.rs:152 — no visibility modifier; not exposed to consumers) implements RetryExecutor, splitting work into execute_impl() (build DeleteData) and commit(). DeleteJob::commit() at delete.rs:248-263 constructs Transaction::new(dataset.manifest.version, Operation::Delete { ... }, None) and then calls CommitBuilder::execute(transaction). The Transaction is built but never returned to callers.
What we'd like
A public DeleteBuilder::execute_uncommitted() -> Result<Transaction> method that runs the same execute_impl + Transaction construction that DeleteJob::commit runs today, but returns the Transaction instead of executing the commit:
let transaction = DeleteBuilder::new(dataset.clone(), "age > 65")
.execute_uncommitted()
.await?;
// ... do other work, decide whether to commit ...
let new_dataset = CommitBuilder::new(dataset).execute(transaction).await?;
Implementation-wise: split DeleteJob::commit() into "build Transaction" (already isolated at delete.rs:248-255) and "execute via CommitBuilder", then expose the build step through a new DeleteBuilder method. No new conflict-resolution work, no change to Operation::Delete's protobuf, no new internals.
References
Problem
DeleteBuilder::execute()(src/dataset/write/delete.rs:136) couples "compute deletion vector / rewrite fragments" with "advance HEAD via manifest commit" as a single operation. There is no public API to stage a delete (compute theDeleteDatawithout advancing HEAD) and commit it later viaCommitBuilder.InsertBuilder::execute_uncommitted(src/dataset/write/insert.rs) andMergeInsertBuilder::execute_uncommittedboth expose a public stage-then-commit shape that returns aTransactionfor the caller to commit viaCommitBuilder::execute.The two-phase shape is already implemented internally for deletes.
DeleteJob(privatestruct DeleteJobatsrc/dataset/write/delete.rs:152— no visibility modifier; not exposed to consumers) implementsRetryExecutor, splitting work intoexecute_impl()(buildDeleteData) andcommit().DeleteJob::commit()atdelete.rs:248-263constructsTransaction::new(dataset.manifest.version, Operation::Delete { ... }, None)and then callsCommitBuilder::execute(transaction). The Transaction is built but never returned to callers.What we'd like
A public
DeleteBuilder::execute_uncommitted() -> Result<Transaction>method that runs the sameexecute_impl+ Transaction construction thatDeleteJob::commitruns today, but returns the Transaction instead of executing the commit:Implementation-wise: split
DeleteJob::commit()into "build Transaction" (already isolated atdelete.rs:248-255) and "execute via CommitBuilder", then expose the build step through a newDeleteBuildermethod. No new conflict-resolution work, no change toOperation::Delete's protobuf, no new internals.References
Operation::Deletetransaction type already exists in the format spec, so the on-disk shape is supported; just the writer-side API is internal.