Hisoka-X commented on code in PR #7261:
URL: https://github.com/apache/seatunnel/pull/7261#discussion_r1694796297
##########
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:
The old Catalog doesn't implement `getDatabaseWithConditionSql` method. So
when invoke this method, the `UnsupportedOperationException` would be throwed.
The difference is that the user need or no need to modify the code
--
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]