dailai commented on code in PR #7261:
URL: https://github.com/apache/seatunnel/pull/7261#discussion_r1694760837
##########
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:
> Do we need to keep the rollback strategy? If Catalog does not support the
`getDatabaseWithConditionSql` method, we can continue to use the old check way.
I think it's no need to use this strategy because all jdbc catalogs are
supported this way.
--
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]