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: CREATE CONNECTION #13489
Comments
it is better to store connection as StorageParams. Otherwise, CONNECTION is only an unchecked map<string, string> 2 solutions:
|
cc @Xuanwo |
I think |
a base StorageParams with hostname="" root = '/' will be stored. |
by the way, logically, most work of parsing connection (a map<string, string>) can be brought forward to the parse stage(now in bind ). |
Databend doesn't support all services that opendal supported. Do you think it's a good idea to maintain a service scheme enum in ast? |
make sense! let me do it! |
As I am working on this issue, need some help. first of all, I am wondering if it is necessary to add this feature.
the motivation of adding UserDefined-Connection
but now we do not need new feature to achieve these 2 points.
so now user only have to input connection detail in DDL. i.e. the connection object is only necessary when create multi external table/stage using one connection or for adding another level of security. for stage related DML&Query, user will have choices: create a connection or create an exteranl stage, not a good thing. we do not have many type of objects for now, so I wonder if we should add this one. for now: URI(bucket, path) + CONNECTION = StorageConfig + path. def of StorageConfig is clear: it provides an we have 2 ways of defining/use it: first. never include the URI part (always used with an uri).
second. may include the URI part or not. let connection corresponds to StorageConfig(mayby incomplete).
the drawback is that there may be an incomplete StorageConfig. |
just to make sure: if we create a stage with a named connection. |
This behavior appears to easily panic users. For instance, User A creates multiple stages with Connection X, but User B accidentally alters Connection X. Consequently, User A discovers that all his stages are disrupted. CONNECTION to me is more like a set of args that could be reused. |
I tried, it turns out it is not suitable for parser to do such dynamic parse work (parse the uri first, then parse the connections dependently), also not easy to get good error message , and there are no big gains. |
@
but it then user have to receate all the external stage/table that created this named connection, based on my discuss earlier. |
I got it. So we will presist CONNECTION in meta and fetch the content of CONNECTION every time we create stage operators. And alter CONNECTION will change all stages created by it. |
The original idea want to make connection as a alias, if we have many external table with same connection, we should define them every where. The original idea to make connection as a object: if user B use a connection which created by A, B maybe not see the ak/sk in the connection, the connection object can apply privileges to show/use and other privileges. |
yes, I think this is the default behavior of most db object ? |
Great, makes sense. |
got it |
connection as object will store in the meta, if stage/external table who use it, we will read the connection in binding phase. |
OpenDAL is currently developing a feature that lets users interact directly with config structs, bypassing the builder: apache/opendal#3240. I believe this will simplify your work. |
We are developing pipe in cloudcontrol, the current requirement for Integration is to enable file listing/notification using our own roles. like the storage integration of snowflake:
Can Databend's Connection achieve a similar effect? |
Yes, connection now is a object like table, we can apply roles to it. cc @TCeason @flaneur2020 |
Yes. It's already in plan. |
Summary
A connection object is connection parameters, and we can apply roles to it in the future.
Syntax:
We can use it in COPY or other places where we need a external storage connection, for example:
More statements:
The text was updated successfully, but these errors were encountered: