-
Notifications
You must be signed in to change notification settings - Fork 987
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
[Core] Support alter database #4700
Conversation
3e184ab
to
1be2269
Compare
530f4fc
to
8593c06
Compare
…CreateDatabaseReques fix RESTCatalog fix checkstyle fail fix error change in RESTCatalog
…o support get set and remove from change
8593c06
to
8b97cf7
Compare
… database when operation on a database fix typo
4cfcdac
to
240c30b
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.
Can you also support ALTER DATABASE for Flink SQL and Spark SQL?
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java
Show resolved
Hide resolved
…reate database in flink
The following SQL sets one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one. | ||
|
||
```sql | ||
ALTER DATABASE [catalog_name.]db_name SET (key1=val1, key2=val2, ...) |
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.
Add example to alter comment and location.
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.
As in flink sql couldn't alter comment for the database, so we could only alter the location.
The following SQL sets one or more properties in the specified database. If a particular property is already set in the database, override the old value with the new one. | ||
|
||
```sql | ||
ALTER { DATABASE | SCHEMA | NAMESPACE } my_database |
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.
Add example to alter comment and location.
try { | ||
Database oldDatabase = catalog.getDatabase(name); | ||
List<PropertyChange> changes = | ||
getPropertyChanges(oldDatabase.options(), newDatabase.getProperties()); |
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.
Here should extract comment from newDatabase?
@Override | ||
public void alterNamespace(String[] namespace, NamespaceChange... changes) { | ||
throw new UnsupportedOperationException("Alter namespace in Spark is not supported yet."); | ||
public void alterNamespace(String[] namespace, NamespaceChange... changes) |
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.
Add test in DDLWithHiveCatalogTestBase
?
+1 |
Purpose
Support alter database
Linked issue: #4540
Tests
API and Format
Documentation