mag1cfrog opened a new issue, #871:
URL: https://github.com/apache/arrow-rs-object-store/issues/871

   **Describe the bug**
   
   `ObjectStoreScheme::parse` drops the first object-key segment when parsing a 
virtual-hosted s3 https URL when the bucket name starts with `s3`
   
   e.g. 
   
   ```
   https://s3bucket.s3.us-east-1.amazonaws.com/table/file.parquet
   ```
   
   returns `file.parquet` instead of `table/file.parquet`.
   
   Reproduced on upstream main at `279572e`.
   
   
   **To Reproduce**
   ```rust
   use object_store::ObjectStoreScheme;
   use url::Url;
   
   #[test]
   fn s3_prefixed_bucket_preserves_object_key() {
       let url = Url::parse(
           "https://s3bucket.s3.us-east-1.amazonaws.com/table/file.parquet";,
       )
       .unwrap();
   
       let (_, path) = ObjectStoreScheme::parse(&url).unwrap();
       assert_eq!(path.as_ref(), "table/file.parquet");
   }
   ```
   
   **Expected behavior**
   Virtual-hosted URLs should preserve the full object key. Path-style URLs 
should continue removing the bucket segment from the path.
   
   **Additional context**
   I have a small fix and regression tests ready for a follow-up PR.


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