SteNicholas commented on code in PR #958:
URL: https://github.com/apache/incubator-paimon/pull/958#discussion_r1173239603
##########
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:
If there are several task that write the table data of this database, what's
the behavior of these tasks?
--
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]