JingsongLi commented on a change in pull request #11791:
URL: https://github.com/apache/flink/pull/11791#discussion_r415204262



##########
File path: 
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -292,18 +303,62 @@ public void alterDatabase(String databaseName, 
CatalogDatabase newDatabase, bool
                checkNotNull(newDatabase, "newDatabase cannot be null");
 
                // client.alterDatabase doesn't throw any exception if there is 
no existing database
-               if (!databaseExists(databaseName)) {
+               Database hiveDB;
+               try {
+                       hiveDB = getHiveDatabase(databaseName);
+               } catch (DatabaseNotExistException e) {
                        if (!ignoreIfNotExists) {
                                throw new DatabaseNotExistException(getName(), 
databaseName);
                        }
 
                        return;
                }
-
-               Database newHiveDatabase = 
instantiateHiveDatabase(databaseName, newDatabase);
+               Map<String, String> params = hiveDB.getParameters();

Review comment:
       I can see `HiveCatalog` becomes big and big, can we split database 
related codes to a separate class?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to