xuefuz commented on a change in pull request #8433: [FLINK-12505][hive] Unify database operations to HiveCatalogBase from its subclasses URL: https://github.com/apache/flink/pull/8433#discussion_r283934117
########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/GenericHiveMetastoreCatalog.java ########## @@ -86,22 +84,20 @@ public GenericHiveMetastoreCatalog(String catalogName, HiveConf hiveConf) { // ------ databases ------ @Override - public CatalogDatabase getDatabase(String databaseName) throws DatabaseNotExistException, CatalogException { - Database hiveDb = getHiveDatabase(databaseName); - - return new GenericCatalogDatabase(hiveDb.getParameters(), hiveDb.getDescription()); - } - - @Override - public void createDatabase(String name, CatalogDatabase database, boolean ignoreIfExists) - throws DatabaseAlreadyExistException, CatalogException { - createHiveDatabase(GenericHiveMetastoreCatalogUtil.createHiveDatabase(name, database), ignoreIfExists); + protected CatalogDatabase createCatalogDatabase(Database hiveDatabase) { + return new GenericCatalogDatabase( + hiveDatabase.getParameters(), + hiveDatabase.getDescription() + ); } @Override - public void alterDatabase(String name, CatalogDatabase newDatabase, boolean ignoreIfNotExists) - throws DatabaseNotExistException, CatalogException { - alterHiveDatabase(name, GenericHiveMetastoreCatalogUtil.createHiveDatabase(name, newDatabase), ignoreIfNotExists); + protected Database createHiveDatabase(String databaseName, CatalogDatabase catalogDatabase) { + return new Database( + databaseName, + catalogDatabase.getComment(), + null, Review comment: Nit: It would be nice to explain what "null" here means. ---------------------------------------------------------------- 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 With regards, Apache Git Services