File tree 2 files changed +14
-3
lines changed
flink-table/flink-table-api-java/src
main/java/org/apache/flink/table/catalog
test/java/org/apache/flink/table/catalog
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -331,13 +331,12 @@ public void createCatalog(
331
331
throw new CatalogException (format ("Catalog %s already exists." , catalogName ));
332
332
}
333
333
} else {
334
- // Store the catalog in the catalog store
335
- catalogStoreHolder .catalogStore ().storeCatalog (catalogName , catalogDescriptor );
336
-
337
334
// Initialize and store the catalog in memory
338
335
Catalog catalog = initCatalog (catalogName , catalogDescriptor );
339
336
catalog .open ();
340
337
catalogs .put (catalogName , catalog );
338
+ // Store the catalog in the catalog store
339
+ catalogStoreHolder .catalogStore ().storeCatalog (catalogName , catalogDescriptor );
341
340
}
342
341
}
343
342
Original file line number Diff line number Diff line change @@ -540,7 +540,19 @@ void testCatalogStore() throws Exception {
540
540
false ))
541
541
.isInstanceOf (CatalogException .class )
542
542
.hasMessage ("Catalog cat_comment already exists." );
543
+ assertThatThrownBy (
544
+ () ->
545
+ catalogManager .createCatalog (
546
+ "cat_no_type" ,
547
+ CatalogDescriptor .of (
548
+ "cat_no_type" ,
549
+ new Configuration (),
550
+ "catalog without type" ),
551
+ false ))
552
+ .isInstanceOf (ValidationException .class )
553
+ .hasMessageContaining ("Unable to create catalog 'cat_no_type'." );
543
554
555
+ assertFalse (catalogManager .listCatalogs ().contains ("cat_no_type" ));
544
556
assertTrue (catalogManager .getCatalog ("cat1" ).isPresent ());
545
557
assertTrue (catalogManager .getCatalog ("cat2" ).isPresent ());
546
558
assertTrue (catalogManager .getCatalog ("cat3" ).isPresent ());
You can’t perform that action at this time.
0 commit comments