laskoviymishka commented on code in PR #3701:
URL: https://github.com/apache/iceberg-rust/pull/3701#discussion_r4694880724
##########
crates/iceberg/src/transaction/mod.rs:
##########
@@ -125,11 +125,36 @@ impl Transaction {
let updated_table = Self::update_table_metadata(table, &updates)?;
existing_updates.extend(updates);
- existing_requirements.extend(requirements);
+ Self::merge_requirements(existing_requirements, requirements);
Ok(updated_table)
}
+ // Catalogs check against the base, so keep only the first requirement per
value.
+ fn merge_requirements(
Review Comment:
Should the kept value come from the base, the way Java's
`UpdateRequirements` builds `AssertRefSnapshotID` from `base.ref(name)`
([L117-L129](https://github.com/apache/iceberg/blob/bb8348b18fa21832048b5fb6873841ba1a8da57e/core/src/main/java/org/apache/iceberg/UpdateRequirements.java#L117-L129))?
The key matches PyIceberg's `_stage`
([L307-L317](https://github.com/apache/iceberg-python/blob/533a617539348c7e111a48b0e8358a6c7370f633/pyiceberg/table/__init__.py#L307-L317)).
As I read it, first-wins only yields the base value while every earlier action
asserts what it changes. Today's actions all do
([snapshot/mod.rs](https://github.com/apache/iceberg-rust/blob/6afc9bf9eb34ebda07def5323570c0fd5801e197/crates/iceberg/src/transaction/snapshot/mod.rs#L447-L463)),
so this is parity, not a bug.
--
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]