CTTY commented on PR #1400:
URL: https://github.com/apache/iceberg-rust/pull/1400#issuecomment-2942404607
Hi,
Thanks for the feedback! I took another look at the transaction code path
implementation in Java today and had some additional thoughts.
- PendingUpdate#apply:
- Responsible for building the item T, if it hasn't been built yet.
- (In the case of SnapshotProducer) It validates table history.
- Generates updated manifest lists and writes them to disk.
- Returns the generic item T held by the PendingUpdate.
- PendingUpdate#commit:
- Retrieves T, which may come from apply() or be built during commit().
- Builds new metadata based on the base table, and applies T to generate
staging metadata.
- (For SnapshotProducer) Asks the catalog to commit the updated metadata —
i.e., flush it to disk and update the catalog pointer to the new metadata.
Mapping to Rust's TransactionAction:
- TransactionAction::apply() should:
- Build the item T, if needed.
- Run SnapshotProduceAction::apply() to validate history and write updated
manifest lists.
- Return the intermediate result T.
- TransactionAction::commit() should:
- Retrieve T.
- Generate staging metadata by updating Transaction.current_table,
Transaction.updates, and Transaction.requirements.
- If needed, call SnapshotProduceAction::commit() →
Catalog::update_table().
I've updated my code to add `Transaction::apply` to be more aligned with the
Java semantics. Please take a look! The current changes are still based on
UpdateLocationAction, which is relatively simple. I'm trying to make the API
usages as close to the Java version as possible (like
[this](https://github.com/apache/iceberg-rust/pull/1400/files#diff-b82ae23a11e32a41bb011f291178762bdd43a4f8dad0ff32e80a9a350d95ce51L347))
Next, I plan to apply this structure to more complex actions like fast
append. Please let me know your thoughts!
--
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]