wjones127 commented on issue #2304:
URL: https://github.com/apache/arrow-rs/issues/2304#issuecomment-1205843494

   It seems like the existing registry stores concrete instances, from what I 
can see in the tests (please correct me if I'm misreading):
   
   ```rust
   let sut = ObjectStoreRegistry::default();
   sut.register_store("hdfs", "localhost:8020", 
Arc::new(LocalFileSystem::new()));
   let url = ListingTableUrl::parse("hdfs://localhost:8020/key").unwrap();
   sut.get_by_url(&url).unwrap();
   ```
   
   This seems problematic for stores like `object_store::aws::AmazonS3` because 
a particular instance is bucket-specific. IIUC that means an 
`ObjectStoreRegistry` could only allow for one bucket at a time, which would 
rule out many use cases.
   
   I'm inclined toward something inspired by the Filesystem API in Arrow C++: 
each implementation has a constructor `FromUri(uri: Uri) -> (Path, Self)` and 
there is a function `ObjectStoreFromUri(uri: Uri) -> (Path, impl ObjectStore)`. 
Not sure how we might register, but I could imagine some API like this *might* 
be possible:
   
   ```rust
   let sut = ObjectStoreRegistry::default();
   sut.register_store("s3", object_store::aws::AmazonS3::FromUri);
   ```
   
   By dispatching to the stores specific `FromUri` method we allow each store 
to handle mapping the URI parts and even query parameters into their own 
options.
   
   Does this align with what you are thinking @roeap?
   


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

Reply via email to