Zouxxyy commented on code in PR #2595:
URL: https://github.com/apache/incubator-paimon/pull/2595#discussion_r1451752055
##########
paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java:
##########
@@ -221,13 +218,16 @@ protected boolean databaseExistsImpl(String databaseName)
{
@Override
protected void createDatabaseImpl(String name) {
try {
- Path databasePath = newDatabasePath(name);
- locationHelper.createPathIfRequired(databasePath, fileIO);
-
- Database database = new Database();
- database.setName(name);
- locationHelper.specifyDatabaseLocation(databasePath, database);
- client.createDatabase(database);
+ Database database = getDatabase(name);
+ if (database == null) {
Review Comment:
No need to add Database database = getDatabase(name); if (database ==
null) {...} here,
see
```java
public void createDatabase(String name, boolean ignoreIfExists)
throws DatabaseAlreadyExistException {
if (isSystemDatabase(name)) {
throw new ProcessSystemDatabaseException();
}
if (databaseExists(name)) {
if (ignoreIfExists) {
return;
}
throw new DatabaseAlreadyExistException(name);
}
createDatabaseImpl(name);
}
```
user should use createDatabase instead of createDatabaseImpl
--
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]