You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/09/18 04:33:16 UTC

[GitHub] [flink] JingsongLi commented on a change in pull request #13414: [FLINK-19227][Table SQL / API] The catalog is still created after opening failed in catalog registering

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



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java
##########
@@ -187,8 +187,8 @@ public void registerCatalog(String catalogName, Catalog catalog) {
 			throw new CatalogException(format("Catalog %s already exists.", catalogName));
 		}
 
-		catalogs.put(catalogName, catalog);
 		catalog.open();
+		catalogs.put(catalogName, catalog);

Review comment:
       Can you add a case for this?
   You can create a Catalog extends `GenericInMemoryCatalog` and implement `open` to throw exception. The check the TableEnv should not contains this catalog.

##########
File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -223,6 +223,9 @@ public String getHiveVersion() {
 	public void open() throws CatalogException {
 		if (client == null) {
 			client = HiveMetastoreClientFactory.create(hiveConf, hiveVersion);
+			if (client == null) {

Review comment:
       This should not happen.




----------------------------------------------------------------
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:
users@infra.apache.org