You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/13 14:16:13 UTC

[GitHub] [arrow-datafusion] timvw opened a new issue, #2525: Bug: ObjectStoreRegistry get_by_uri does not return correct path when "scheme" is provided

timvw opened a new issue, #2525:
URL: https://github.com/apache/arrow-datafusion/issues/2525

   **Describe the bug**
   object_store_registry.get_by_uri does not work as expected.
   
   **To Reproduce && Expected behavior**
   ```rust
       #[test]
       fn test_get_by_uri_s3() {
           let sut = ObjectStoreRegistry::default();
           sut.register_store("s3".to_string(), Arc::new(LocalFileSystem {}));
           let uri = "s3://bucket/key";
           let (_, path) = sut.get_by_uri(uri).unwrap();
           assert_eq!(path, "bucket/key");
       }
   
       #[test]
       fn test_get_by_uri_file() {
           let sut = ObjectStoreRegistry::default();
           let uri = "file:///bucket/key";
           let (_, path) = sut.get_by_uri(uri).unwrap();
           assert_eq!(path, "/bucket/key");
       }
   
       #[test]
       fn test_get_by_uri_local() {
           let sut = ObjectStoreRegistry::default();
           let uri = "/bucket/key";
           let (_, path) = sut.get_by_uri(uri).unwrap();
           assert_eq!(path, "/bucket/key");
       }
   ```
   
   **Additional context**
   This issue is not uncovered with local files, because LocalFileSystem does some additional "magic" to workaround the issue:
   
   ```rust
   impl ObjectStore for LocalFileSystem {
       async fn list_file(&self, prefix: &str) -> Result<FileMetaStream> {
           let prefix = if let Some((_scheme, path)) = prefix.split_once("://") {
               path
           } else {
               prefix
           };
           list_all(prefix.to_owned()).await
       }
   ```


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


[GitHub] [arrow-datafusion] alamb closed issue #2525: Bug: ObjectStoreRegistry get_by_uri does not return correct path when "scheme" is provided

Posted by GitBox <gi...@apache.org>.
alamb closed issue #2525: Bug: ObjectStoreRegistry get_by_uri does not return correct path when "scheme" is provided
URL: https://github.com/apache/arrow-datafusion/issues/2525


-- 
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-unsubscribe@arrow.apache.org

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