-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object_store: allow setting content-type per request #5329
Comments
It looks like #4754 was closed by accident, #4999 only added a workaround for object tagging, whereas the ticket tracks supporting arbitrary object metadata. It also enumerates some of the challenges; including lack of support in listing APIs and unclear semantics for LocalFilesystem. I would strongly encourage you to encode such metadata in the object path, as opposed to relying on metadata attributes, the different stores do not handle metadata in anything approaching a consistent manner. |
Encoding this metadata in the object path itself means I need to effectively check two different keys :-/ The listing API already doesn't guarantee order, I personally would feel Ok if on backends where the API listing endpoint doesn't return content-types we would not populate the field for list, and only on a get request. These are things that can be mentioned in the documentation. Regarding This shouldn't affect behaviour where the content-type isn't set explicitly, and also shouldn't swallow desired content types without any notice. |
Fair enough, if you aren't listing and are instead going to the path directly, this would be harder.
One option might be to include the
Yes, that would be the plan Edit: I'll try to find some time later this week to prototype some things |
Awesome, feel free to poke me on a draft PR or something, happy to give feedback and test things out! |
Hi, I think we should handle Storing |
Yes the design needs to support:
I am iterating on such a design currently |
|
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I'd like to use
object_store
to store blobs (and stay somewhat cloud-provider agnostic).Depending on the size/nature of the blob, I either break it further down, or store it as-is. I need to distinguish these two cases when reading the data back in, and I'd like to use the widely-supported content-type field for this (it's either application/octet-stream, or some index content-type).
The decision of which content-type to use can't be made statically, but needs to happen per request. Which means the existing content-type mechanism (default, or map from extension to content-type) is not sufficient.
Describe the solution you'd like
Add an optional
content_type
field toPutOptions
. In case it's notNone
, use that content type in favor of any of the existing logic.Additionally, add an optional
content_type
field toObjectMeta
. Most backends already send the content type anyways, so populating it should be quite limited in cost, and no explicit different client config should be necessary.Describe alternatives you've considered
Using custom metadata, as introduced in #4999. This however is distinct from content-type and requires an additional request for some backends (AWS), while content-type is sent inline alongside the data.
The text was updated successfully, but these errors were encountered: