-
Notifications
You must be signed in to change notification settings - Fork 881
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
feat: add Extensions
to object store GetOptions
#7170
Conversation
2f96709
to
55ec411
Compare
I like this approach and think it would be fine. I do, however, wonder if we're somewhat overloading the ObjectStore interface a bit much. I've filed #7171 to articulate this and perhaps explore the design space a bit more |
As the author of #7155 where my intent was to end up with something that could be compatible with datafusion's With the API surface you've provided for inserting new elements into Let's say that The problem is that the A |
You could add DataFusion's entire Extensions bundle here, whilst you would have two indirections, it would be the least magical mechanism for doing this. That being said, I am increasingly of the opinion the ObjectStore trait is being overloaded for something it fundamentally is not designed to be, and I would be interested in your thoughts on #7171. It seems really odd to me that we need to extend the ObjectStore trait, a generic interface to object stores, to support propagating DF context through to an IOx subsystem. This screams to me of a missing / incorrect layer of abstraction. I wonder if instead IOx could be using a less generic trait, e.g. overriding AsyncFileReaderFactory, or similar? |
Do you mean that instead of the
Yeah I'm taking a look at that now, I'll see if I can think of any useful feedback for you there.
I'm still pretty new to datafusion ecosystem but it seems to me like using it the way influxdb is more or less requires passing in some kind of |
No I mean registering the entire DF's Extensions bundle onto the ObjectStore Extensions bundle
It would entail making changes to how InfluxDB is using this, correct. I believe it shouldn't require changes to DF, given that AsyncFileReaderFactory was added to enable using DF with other IO abstractions such as OpenDAL. |
The reason I'm thinking it might require changes to DF is that InfluxDB registers object stores with what looks to me like a fairly core type: https://github.com/apache/datafusion/blob/22156b2a6862e68495a82bd2579d3ba22c6c5cc0/datafusion/execution/src/runtime_env.rs#L78 Is this not actually required? I've observed it in use in a few places, but maybe those are edge cases that aren't applicable to InfluxDB. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a pragmatic solution, and would be happy to merge it.
That being said, I wonder what you think of using http::Extensions instead.
This would lose debug support, and making http
a required dependency, but would have the advantage of being a standard ecosystem abstraction, and would allow for a pretty compelling way to pass through any extensions to the HttpClient implementation (#7183)
I think FWIW InfluxData already uses I'll leave this PR open for now and rebase & adjust it after #7183 gets merged. |
55ec411
to
8479465
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we wire these through to HttpClient as part of this?
I can. Another question: should we make the |
I would prefer to make it mandatory, it is a relatively simple crate and don't foresee any issues |
8479465
to
0915500
Compare
version: _, | ||
head: _, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to unpack the struct to make the forwarding here easier to maintain (so new fields are not forgotten). However we seem to have missed these two.
@tustvold is this a bug? Shouldn't we at least wire up version
? And head
should probably change the method, but I'm not sure how much will break if we do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version is object store specific what it means and so is handled that way, head requests is likely historical.
I wouldn't object to finding a way to roll the logic into here, but it isn't entirely straightforward to do
I presume you will follow this up with PRs for the other Options structs |
Done in #7213. |
Which issue does this PR close?
Closes #7155.
Rationale for this change
See #7155.
What changes are included in this PR?
The
Extensions
type and the newGetOptions::extensions
field.Are there any user-facing changes?
Adding a field to
GetOptions
is technically a breaking change.