liyubin117 commented on code in PR #24934:
URL: https://github.com/apache/flink/pull/24934#discussion_r1639245307


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java:
##########
@@ -295,31 +295,42 @@ public DataTypeFactory getDataTypeFactory() {
      *
      * @param catalogName the given catalog name under which to create the 
given catalog
      * @param catalogDescriptor catalog descriptor for creating catalog
+     * @param ignoreIfExists if false exception will be thrown if a catalog 
exists.
      * @throws CatalogException If the catalog already exists in the catalog 
store or initialized
      *     catalogs, or if an error occurs while creating the catalog or 
storing the {@link
      *     CatalogDescriptor}
      */
-    public void createCatalog(String catalogName, CatalogDescriptor 
catalogDescriptor)
+    public void createCatalog(
+            String catalogName, CatalogDescriptor catalogDescriptor, boolean 
ignoreIfExists)
             throws CatalogException {
         checkArgument(
                 !StringUtils.isNullOrWhitespaceOnly(catalogName),
                 "Catalog name cannot be null or empty.");
         checkNotNull(catalogDescriptor, "Catalog descriptor cannot be null");
 
         if (catalogStoreHolder.catalogStore().contains(catalogName)) {
-            throw new CatalogException(
-                    format("Catalog %s already exists in catalog store.", 
catalogName));
+            if (!ignoreIfExists) {

Review Comment:
   good idea



##########
flink-core/src/test/java/org/apache/flink/core/io/LocatableSplitAssignerTest.java:
##########
@@ -428,7 +428,7 @@ void testConcurrentSplitAssignmentForMultipleHosts() throws 
InterruptedException
         assertThat(ia.getNextInputSplit("testhost", 0)).isNull();
 
         // at least one fraction of hosts needs be local, no matter how bad 
the thread races
-        assertThat(ia.getNumberOfRemoteAssignments())
+        assertThat(ia.getNumberOfLocalAssignments())

Review Comment:
   done



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to