dawidwys commented on code in PR #25907:
URL: https://github.com/apache/flink/pull/25907#discussion_r1905149120


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java:
##########
@@ -1012,9 +1012,17 @@ public String qualifyDatabase(@Nullable String 
databaseName) {
      * @param table The table to put in the given path.
      * @param objectIdentifier The fully qualified path where to put the table.
      * @param ignoreIfExists If false exception will be thrown if a table 
exists in the given path.
+     * @return true if table was created in the given path, false if a table 
already exists in the
+     *     given path.
      */
-    public void createTable(
+    public boolean createTable(
             CatalogBaseTable table, ObjectIdentifier objectIdentifier, boolean 
ignoreIfExists) {
+        if (ignoreIfExists) {
+            final Optional<CatalogBaseTable> resultOpt = 
getUnresolvedTable(objectIdentifier);
+            if (resultOpt.isPresent()) {
+                return false;
+            }
+        }

Review Comment:
   I am a bit worried this violates contracts of `Catalog#createTable` and 
`CatalogModificationListener`.
   
   We won't ever call those classes if the table exists with thee proposed 
change. Previously particular implementations could have a custom logic on the 
combination of `ignoreIfExists` and the table present.



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