This is an automated email from the ASF dual-hosted git repository.

liurenjie1024 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 292304b2 Try infer file io scheme from metadata location ahead of 
warehouse path (#1590)
292304b2 is described below

commit 292304b239ef328b3fcfc4c4c58a33cdb121afbb
Author: Dai Yiyang <[email protected]>
AuthorDate: Fri Aug 8 17:54:52 2025 +0800

    Try infer file io scheme from metadata location ahead of warehouse path 
(#1590)
    
    ## Which issue does this PR close?
    
    - Closes #1589
    
    ## What changes are included in this PR?
    
    As S3Tables REST endpoint accept `warehouse` only in ARN format,
    Current code logic will infer file io scheme through `warehouse_path` in
    ARN format as `arn` which is wrong and unable to be processed.
    
    Changed the code logic to try infer file io scheme with
    `metadata_location` before `warehouse_path`,
    This makes file io scheme infer as `s3` correctly.
    
    ## Are these changes tested?
    
    Test only in `load_table` path for rest catalog implementation
---
 crates/catalog/rest/src/catalog.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/catalog/rest/src/catalog.rs 
b/crates/catalog/rest/src/catalog.rs
index 7d81982f..f6c63362 100644
--- a/crates/catalog/rest/src/catalog.rs
+++ b/crates/catalog/rest/src/catalog.rs
@@ -320,7 +320,7 @@ impl RestCatalog {
             None => None,
         };
 
-        let file_io = match warehouse_path.or(metadata_location) {
+        let file_io = match metadata_location.or(warehouse_path) {
             Some(url) => FileIO::from_path(url)?
                 .with_props(props)
                 .with_extensions(self.file_io_extensions.clone())

Reply via email to