s7monk commented on code in PR #958:
URL: https://github.com/apache/incubator-paimon/pull/958#discussion_r1173260739
##########
paimon-core/src/main/java/org/apache/paimon/catalog/FileSystemCatalog.java:
##########
@@ -99,6 +99,24 @@ public void dropDatabase(String name, boolean
ignoreIfNotExists, boolean cascade
uncheck(() -> fileIO.delete(databasePath(name), true));
}
+ @Override
+ public void renameDatabase(String fromDatabase, String toDatabase, boolean
ignoreIfNotExists)
+ throws DatabaseNotExistException, DatabaseAlreadyExistException {
+ if (!databaseExists(fromDatabase)) {
+ if (ignoreIfNotExists) {
+ return;
+ }
+
+ throw new DatabaseNotExistException(fromDatabase);
+ }
+
+ if (databaseExists(toDatabase)) {
+ throw new DatabaseAlreadyExistException(toDatabase);
+ }
+
+ uncheck(() -> fileIO.rename(databasePath(fromDatabase),
databasePath(toDatabase)));
Review Comment:
I think that if there are multiple tasks writing to this database, after
modifying the database name, all tasks need to re-designate the database. Is
there any way to make the writing task aware of the database name change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]