-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Extend syntax for Dynamic Catalogs #22188
base: master
Are you sure you want to change the base?
Conversation
- SHOW CREATE - RENAME - SET PROPERTIES
Co-authored-by: Jan Waś <[email protected]>
Co-authored-by: Jan Waś <[email protected]>
@martint @dain @kokosing @nineinchnick @SemionPar please review |
@@ -155,6 +162,7 @@ statement | |||
| EXPLAIN ANALYZE VERBOSE? statement #explainAnalyze | |||
| SHOW CREATE TABLE qualifiedName #showCreateTable | |||
| SHOW CREATE SCHEMA qualifiedName #showCreateSchema | |||
| SHOW CREATE CATALOG identifier #showCreateCatalog |
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.
The current implementation exposes all properties even if it's marked as @ConfigHidden
or @ConfigSecuritySensitive
. I think we should hide or redact such properties.
@@ -53,8 +53,15 @@ statement | |||
(COMMENT string)? | |||
(AUTHORIZATION principal)? | |||
(WITH properties)? #createCatalog | |||
| CREATE CATALOG (IF NOT EXISTS)? target=identifier | |||
LIKE source=identifier |
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.
What's the use case for "LIKE ..."? What are its semantics when WITH
is also provided?
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.
The use case is when you need to create target
catalog similar to a source
one, overriding some properties.
E.g. you have postgresql catalog configured, which points to db1
, and for another database db2
you want to specify similar, but different catalog. So you have to override only URL/password via WITH
.
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.
LIKE is typically used for pattern matching and not for copying/templating .. so the grammar probably need to be changed. As this stands with LIKE it is counterintuitive to any user.
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.
It's already used in CREATE TABLE, this mimics it
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.
oh yeah .. you are right. I guess with that in mind it might actually make sense.
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
I am adding the stale-ignore label under the assumption that you are still driving this PR to completion @ssheikin |
Session session = stateMachine.getSession(); | ||
|
||
accessControl.checkCanRenameCatalog(session.toSecurityContext(), statement.getSource().getValue(), statement.getTarget().getValue()); | ||
|
||
catalogManager.renameCatalog(new CatalogName(statement.getSource().getValue()), new CatalogName(statement.getTarget().getValue())); |
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.
Did you omit lowercase intentionally?
trino> CREATE CATALOG test USING memory;
CREATE CATALOG
trino> ALTER CATALOG test RENAME TO TEST;
RENAME CATALOG
trino> show catalogs;
Catalog
---------
TEST
memory
system
tpch
(4 rows)
Description
RENAME
,SET PROPERTIES
implementedcatalog owner
is not supported yet.catalog comment
is not supported yet.Additional context and related issues
Trino epic #12709
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: