apache / apache/arrow-rs-object-store
Add `Content-Type` to `ObjectMetadata`
- Dominant language
- Rust
- Stars
- 322
- Forks
- 212
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 10
Description
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
Currently `Content-Type` is not included in object metadata. It is instead available in `Attributes` only. But the `ListResult` only includes `ObjectMetadata` structs. Most of object stores return `Content-Type` in list metadata. That is imperative to show a list ui with proper mime-type, etc. As that information is not propagated by `object_store` interface in `ListResult`, it curtails many use cases.
**Describe the solution you'd like**
Include `content_type: Option` like field in `ObjectMetadata`, and populate it during construction of `ListResult`. For backends that doesn't have notion of content-type, we can have populate with `None`.
**Describe alternatives you've considered**
Make seperate request for full metadata. This have issue with listing, as we have to make O(n) requests for a list with `n` items, where as all modern object-stores directly provides `content-type` in list result.
Contributor guide
Research direction
Start by locating the ObjectMetadata and ListResult definitions and the object_store interface, then trace how each backend constructs list metadata. Add the optional content_type value to ObjectMetadata and populate it where backends expose it, using None where they do not; done means list results carry the MIME type without requiring per-object metadata requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100