CTTY commented on code in PR #1549:
URL: https://github.com/apache/iceberg-rust/pull/1549#discussion_r2228992521
##########
crates/iceberg/src/catalog/memory/catalog.rs:
##########
@@ -289,12 +293,31 @@ impl Catalog for MemoryCatalog {
.build()
}
- /// Update a table to the catalog.
- async fn update_table(&self, _commit: TableCommit) -> Result<Table> {
- Err(Error::new(
- ErrorKind::FeatureUnsupported,
- "MemoryCatalog does not currently support updating tables.",
- ))
+ /// Update a table in the catalog.
+ async fn update_table(&self, commit: TableCommit) -> Result<Table> {
+ let mut root_namespace_state = self.root_namespace_state.lock().await;
+
+ // Updates the current table version and writes a new metadata file.
+ let current_table = self
+ .load_table_from_locked_state(commit.identifier(),
&root_namespace_state)
+ .await?;
+
+ // Apply TableCommit to get staged table
+ let staged_table = commit.apply(current_table)?;
+
+ // Write table metadata to the new location
+ staged_table
+ .metadata()
+ .write_to(
+ staged_table.file_io(),
+ staged_table.metadata_location().unwrap(),
Review Comment:
The new metadata location would be generated in `TableCommit::apply` and
attached to the staged table
--
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]