c-thiel commented on code in PR #689:
URL: https://github.com/apache/iceberg-rust/pull/689#discussion_r1834624350


##########
crates/iceberg/src/catalog/mod.rs:
##########
@@ -453,6 +453,115 @@ impl TableUpdate {
     }
 }
 
+impl TableRequirement {
+    /// Check that the requirement is met by the table metadata.
+    /// If the requirement is not met, an appropriate error is returned.
+    pub fn check(&self, metadata: &TableMetadata, exists: bool) -> Result<()> {

Review Comment:
   You are right, this is better.
   My motivation was that the `Option` approach is not able to combine any 
other Requirement with the `TableDoesNotExist` Requirement. Paradoxically 
tables can actually `NotExist` even if Metadata is available: The 
`staged-create` create table does exactly this - prepare metadata while the 
table technically doesn't exist yet.
   
   However, I checked Java, and it doesn't allow the combination in question, 
so we don't need to prepare for it.
   
https://github.com/apache/iceberg/blob/fff9ec3bbc322080da6363b657415b039c0e92a0/core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java#L361C1-L376C4



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to