thinkharderdev commented on issue #4754: URL: https://github.com/apache/arrow-rs/issues/4754#issuecomment-1772856514
Object tagging as in https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html > Can you provide any context on why you need to read tags? We use tags to drive retention policies > Are the tags you wish to write static or do they vary based on request There is a static set of tags but which tags get applied to any given object is dynamic > If they vary do they do so based on path or extension in a predictable manner? No, it would not be possible to do this based on some static rules. It would have to be a mechanism that allows tagging of individual put requests. I'm also a little hesitant to try and abstract this as there are a lot of subtle differences between APIs so it would be a little bit hard to make sure the default `ObjectStore` implementations work across providers. That said, adding a maximally flexible API interface at least allows custom implementations that can do whatever they want. So something as simple as what you proposed in the ticket might be ok even if the exact semantics are not consistent across different object storage APIs. Alternatively, maybe we could punt on the whole issue by providing a canonical way to extend the `ObjectStore` interface. Something like (and just spitballing here :)) ``` pub trait ObjectStoreExt { fn as_any(&self) -> &dyn Any // Just need to allow for downcasting to concrete type } pub trait ObjectStore { type Ext: ObjectStoreExt fn extension(&self) -> Ext; } ``` Then there could be standard extansions in the default impl: ``` pub struct AwsObjectStoreExt { async fn get_tags(&self, path: &Path) -> Result<HashMap<String,String>> async fn put_tags(&self, path: &Path, tags: &HashMap<String,String>) } ``` -- 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]
