DerGut commented on code in PR #1549:
URL: https://github.com/apache/iceberg-rust/pull/1549#discussion_r2230460092
##########
crates/iceberg/src/catalog/memory/catalog.rs:
##########
@@ -1754,4 +1792,89 @@ mod tests {
metadata_location
);
}
+
+ #[tokio::test]
+ async fn test_update_table() {
+ let catalog = new_memory_catalog();
+
+ let table = create_table_with_namespace(&catalog).await;
+
+ // Assert the table doesn't contain the update yet
+ assert!(!table.metadata().properties().contains_key("key"));
+
+ // Update table metadata
+ let tx = Transaction::new(&table);
+ let updated_table = tx
+ .update_table_properties()
+ .set("key".to_string(), "value".to_string())
+ .apply(tx)
+ .unwrap()
+ .commit(&catalog)
+ .await
+ .unwrap();
+
+ assert_eq!(
+ updated_table.metadata().properties().get("key").unwrap(),
+ "value"
+ );
+
+ assert_eq!(table.identifier(), updated_table.identifier());
+ assert_eq!(table.metadata().uuid(), updated_table.metadata().uuid());
+ assert!(table.metadata().last_updated_ms() <
updated_table.metadata().last_updated_ms());
+ assert_ne!(table.metadata_location(),
updated_table.metadata_location());
+
+ println!("left: {:?}", table.metadata().metadata_log());
+ println!("right: {:?}", updated_table.metadata().metadata_log());
Review Comment:
Are these for testing?
--
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]