Skip to content

S3Resource getUri() #521

Open
Open
@fjmacagno

Description

@fjmacagno

Type: Feature

Is your feature request related to a problem? Please describe.
I have found that several people i work with have assumed that S3Resource.getUri() would return the s3 url for the resource, aka s3://bucket/key, and run into unexpected trouble when it comes back as an http url. This in particular causes trouble when interacting with other libraries like Parquet, which cannot use an InputStream to read and which ideally we should be able to pass the uri to directly.

Describe the solution you'd like
Why is it this way? Couldn't it return the s3 path? Is that even changeable at this point, if it is desirable?

Describe alternatives you've considered
Im currently telling people to string-parse the uri host for the bucket and use the uri path for the key and build the s3 url manually.

Additional context
Looking at the code, it seems like the problem may be that the default implementation of getUri() in AbstractResource parses the result of getURL(), and URLs cant have filesystems that Java can't recognize. It seems like just overriding getUri() would fix it, but then you do have the URL and the URI being meaningfully different, which is its own disadvantage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: s3S3 integration related issuetype: enhancementSmaller enhancement in existing integration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions