criccomini commented on PR #348:
URL: 
https://github.com/apache/arrow-rs-object-store/pull/348#issuecomment-2860955434

   @kylebarron Looking at the delta-rs code a bit more. It seems like the 
`ObjectStoreFactoryRegistry` stuff is perhaps a bit closer to what the 
`ObjectStoreRegistry` does in this PR:
   
   
https://github.com/delta-io/delta-rs/blob/3d2bbef5cb7c5f6b7e5d1b778edbfd098e993bc3/crates/core/src/logstore/factories.rs#L64-L94
   
   In particular `store_for` looks pretty close. I wonder if something like 
this would work:
   
   ```rust
   /// Simpler access pattern for the [ObjectStoreFactoryRegistry] to get a 
single store
   pub fn store_for<K, V, I>(url: &Url, options: I) -> 
DeltaResult<ObjectStoreRef>
   where
       I: IntoIterator<Item = (K, V)>,
       K: AsRef<str> + Into<String>,
       V: AsRef<str> + Into<String>,
   {
       if let Some(store) = object_store_registry.get_store(&url) {
           return store;
       } else { // TODO would need to validate scheme is memory/url
           let (store, _) = object_store::parse_url_opts(url, options);
           Ok(Arc::new(store))
       } else {
           Err(DeltaTableError::InvalidTableLocation(url.clone().into()))
       }
   }
   ```
   
   Admittedly, I didn't dig into the storage config stuff. Just sort of 
spit-balling to pressure test this PR's API.


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to