blackmwk commented on code in PR #2998:
URL: https://github.com/apache/iceberg-rust/pull/2998#discussion_r3842531756
##########
crates/iceberg/src/transaction/mod.rs:
##########
@@ -171,6 +171,37 @@ impl Transaction {
ExpireSnapshotsAction::new()
}
+ /// Stage this transaction: run every action against the transaction's
+ /// base table and return the resulting [`TableCommit`] **without** sending
+ /// it to a catalog.
+ ///
+ /// This is the first half of [`commit`](Self::commit). It produces the
+ /// exact same updates and requirements that `commit` would pass to
+ /// [`Catalog::update_table`] on its first attempt — including any files an
+ /// action writes to the table's storage, such as a fast-append's manifest
+ /// and manifest list. The second half (refresh-and-retry against the
+ /// catalog) is left to the caller.
+ ///
+ /// Use this when you own the commit path: an embedded writer that swaps
+ /// the metadata pointer itself, or a caller that folds several tables'
+ /// staged commits into one atomic multi-table commit. The staged
+ /// [`TableCommit`] can be applied locally with [`TableCommit::apply`],
+ /// taken apart with [`TableCommit::take_updates`] /
+ /// [`TableCommit::take_requirements`], or handed to
+ /// [`Catalog::update_table`] as-is.
+ ///
+ /// Staging is against the transaction's base table snapshot as it was when
+ /// the transaction was created; it does not refresh from a catalog.
+ pub async fn stage(&self) -> Result<TableCommit> {
Review Comment:
I don't think this is the right direction to go:
1. For your first requirement, you should provide your own catalog
implementation.
2. For the second requirement, it's multi table transaction, which is under
discussion in community.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]