Hisoka-X commented on code in PR #7261:
URL: https://github.com/apache/seatunnel/pull/7261#discussion_r1694769571


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java:
##########
@@ -277,15 +285,24 @@ public List<String> listDatabases() throws 
CatalogException {
 
     @Override
     public boolean databaseExists(String databaseName) throws CatalogException 
{
-        checkArgument(StringUtils.isNotBlank(databaseName));
-
-        return listDatabases().contains(databaseName);
+        if (StringUtils.isBlank(databaseName)) {
+            return false;
+        }
+        if (!SYS_DATABASES.isEmpty() && SYS_DATABASES.contains(databaseName)) {
+            return false;
+        }
+        return queryExists(
+                getUrlFromDatabaseName(databaseName), 
getDatabaseWithConditionSql(databaseName));

Review Comment:
   But if the user adds a custom Catalog, it needs to be re-adapted. This is my 
concern.



-- 
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: commits-unsubscr...@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to