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


##########
crates/storage/opendal/src/resolving.rs:
##########
@@ -272,12 +279,30 @@ impl OpenDalResolvingStorage {
             return Ok(storage.clone());
         }
 
-        let storage = build_storage_for_scheme(
-            scheme,
-            &self.props,
-            #[cfg(feature = "opendal-s3")]
-            &self.customized_credential_load,
-        )?;
+        // A prefix such as `s3://bucket/` or `s3` names its scheme, and never
+        // matches the paths of another.
+        let storage_credentials = self
+            .storage_credentials
+            .iter()
+            .filter(|credential| {
+                let prefix = credential.prefix();
+                let name = prefix.split_once(':').map_or(prefix, |(name, _)| 
name);

Review Comment:
   Done, it uses `extract_scheme` now. I kept a `parse_scheme` fallback because 
a bare `s3` is a valid prefix, as in Java's `S3FileIO`, but `Url::parse` 
rejects it.
   



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