plusplusjiajia commented on code in PR #3784:
URL: https://github.com/apache/iceberg-rust/pull/3784#discussion_r4738179691


##########
crates/iceberg/src/transaction/mod.rs:
##########
@@ -274,7 +276,9 @@ impl Transaction {
             .requirements(existing_requirements)
             .build();
 
-        catalog.update_table(table_commit).await
+        let committed = catalog.update_table(table_commit).await?;
+        // The table `update_table` returns may lack the vended credentials.
+        Ok(committed.with_file_io(current_table.file_io().clone()))

Review Comment:
   @blackmwk Thanks for the review! Agreed, I've moved this out of 
`Transaction`. A REST commit response carries neither storage credentials nor 
table config, so the table `update_table` built also lost per-table config such 
as `s3.endpoint` or `region`, not only the credentials. Following an earlier 
suggestion in #2651, `TableCommit` now carries the FileIO of the load 
`Transaction` makes before committing, and `RestCatalog::update_table` builds 
the returned table with it, like Java's `RESTTableOperations` keeping the 
table's FileIO across commits. Could you take another look?
   



##########
crates/iceberg/src/transaction/mod.rs:
##########
@@ -253,7 +253,9 @@ impl Transaction {
             self.table = refreshed.clone();
         }
 
-        let mut current_table = self.table.clone();
+        // Use the storage credentials this load vended, even when the base is
+        // current: the base's may have expired.
+        let mut current_table = 
self.table.clone().with_file_io(refreshed.file_io().clone());

Review Comment:
   Removed, thanks.



##########
crates/iceberg/src/table.rs:
##########
@@ -570,6 +578,28 @@ mod tests {
         assert!(Arc::ptr_eq(&manifest_list, &from_cache));
     }
 
+    #[tokio::test]
+    async fn test_table_with_file_io_reads_manifests_through_it() {

Review Comment:
   `Table::with_file_io` is no longer needed, so I've removed it along with 
this test.



-- 
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]

Reply via email to