File tree Expand file tree Collapse file tree
flink-table/flink-table-api-java/src
main/java/org/apache/flink/table/catalog
test/java/org/apache/flink/table/catalog Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,13 +331,12 @@ public void createCatalog(
331331 throw new CatalogException (format ("Catalog %s already exists." , catalogName ));
332332 }
333333 } else {
334- // Store the catalog in the catalog store
335- catalogStoreHolder .catalogStore ().storeCatalog (catalogName , catalogDescriptor );
336-
337334 // Initialize and store the catalog in memory
338335 Catalog catalog = initCatalog (catalogName , catalogDescriptor );
339336 catalog .open ();
340337 catalogs .put (catalogName , catalog );
338+ // Store the catalog in the catalog store
339+ catalogStoreHolder .catalogStore ().storeCatalog (catalogName , catalogDescriptor );
341340 }
342341 }
343342
Original file line number Diff line number Diff line change @@ -540,7 +540,19 @@ void testCatalogStore() throws Exception {
540540 false ))
541541 .isInstanceOf (CatalogException .class )
542542 .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'." );
543554
555+ assertFalse (catalogManager .listCatalogs ().contains ("cat_no_type" ));
544556 assertTrue (catalogManager .getCatalog ("cat1" ).isPresent ());
545557 assertTrue (catalogManager .getCatalog ("cat2" ).isPresent ());
546558 assertTrue (catalogManager .getCatalog ("cat3" ).isPresent ());
You can’t perform that action at this time.
0 commit comments