diff --git a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java index aebaf71f88d3..ad5ad73d424b 100644 --- a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java +++ b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSource.java @@ -57,7 +57,7 @@ public JdbcSource(JdbcSourceConfig jdbcSourceConfig) { JdbcCatalogUtils.getTables( jdbcSourceConfig.getJdbcConnectionConfig(), jdbcSourceConfig.getTableConfigList(), - this.jdbcSourceConfig); + this.jdbcSourceConfig.getDialectName()); } @Override diff --git a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java index 753a8c5311f2..c766cdbc249c 100644 --- a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java +++ b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java @@ -34,7 +34,6 @@ import org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.JdbcCatalogOptions; import org.apache.seatunnel.connectors.seatunnel.jdbc.catalog.utils.CatalogUtils; import org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcConnectionConfig; -import org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcSourceConfig; import org.apache.seatunnel.connectors.seatunnel.jdbc.config.JdbcSourceTableConfig; import org.apache.seatunnel.connectors.seatunnel.jdbc.internal.connection.JdbcConnectionProvider; import org.apache.seatunnel.connectors.seatunnel.jdbc.internal.dialect.JdbcDialect; @@ -66,7 +65,7 @@ public class JdbcCatalogUtils { public static Map getTables( JdbcConnectionConfig jdbcConnectionConfig, List tablesConfig, - JdbcSourceConfig sourceConfig) + String dialectName) throws SQLException, ClassNotFoundException { Map tables = new LinkedHashMap<>(); @@ -74,7 +73,7 @@ public static Map getTables( JdbcDialectLoader.load( jdbcConnectionConfig.getUrl(), jdbcConnectionConfig.getCompatibleMode(), - sourceConfig.getDialectName()); + dialectName); Optional catalog = findCatalog(jdbcConnectionConfig, jdbcDialect); if (catalog.isPresent()) { try (AbstractJdbcCatalog jdbcCatalog = (AbstractJdbcCatalog) catalog.get()) {