-
Notifications
You must be signed in to change notification settings - Fork 517
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
Support creating operator from URL #5407
Comments
Hi, I'm interested in addressing this. Did you start working on this @Xuanwo ? apache/hudi-rs#131 (comment) |
Hi, thank you very much for your interest. I'm currently working on a design for this. |
hi @Xuanwo, this issue was closed by the RFC PR, is that intended? should we reopen that until the RFC is implemented? |
Discussed in #1494
Originally posted by frostming March 7, 2023
Proposal
I propose an alternative approach to create an opendal Operator -- from a resource URI(or URL? either is good) string.
I am new to OpenDAL and feel free to close it if it is already a thing -- That's great!
Examples:
This does the same as
Another example, HDFS:
Advantages
Builder
structs at all. For a minimal interface, anOperator
struct is sufficient, service backends can be set up with a primitive string. This will significantly save the effort of supporting a new language.Possible Solutions
We already have a unique
Scheme
for each Builder, we can give them a unique URL prefix. The URI will be encoded as follows:Where positional arguments are required parameters for the specific service, such as
root
forFs
. Specifically, the URI will be parsed withUrl::parse
, and thequery_pairs
will be fed to the::from_iter()
method of the corresponding Builder to get a builder object. Thanks to the good API design of OpenDAL, these APIs are ready to do this.Be aware because all values are URL components, they must be percent-encoded.
Some concerns
For some services that use URL as the parameter themselves, such as IPFS, the resource URI will be a bit different:
And there can be multiple schemes map to the same builder. Both
http://
andhttps://
map to HTTP builder.This might cause some confusion, so I will leave it to the maintainers to make the choice of how this feature will go.
The text was updated successfully, but these errors were encountered: