diff --git a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/thirdparty/datasource/impl/BaseJdbcDataSourceConfigSwitcher.java b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/thirdparty/datasource/impl/BaseJdbcDataSourceConfigSwitcher.java index 9c2a21053..f5136b87b 100644 --- a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/thirdparty/datasource/impl/BaseJdbcDataSourceConfigSwitcher.java +++ b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/thirdparty/datasource/impl/BaseJdbcDataSourceConfigSwitcher.java @@ -139,12 +139,12 @@ public Config mergeDatasourceConfig( List tableFields = selectTableFields.getTableFields(); String sql = tableFieldsToSql(tableFields, databaseName, tableName); - - String where_condition = connectorConfig.getString(WHERE_CONDITION); - - if (where_condition != null && !where_condition.isEmpty()) { - sql = sql + " " + where_condition; - connectorConfig = connectorConfig.withoutPath(WHERE_CONDITION); + if (connectorConfig.hasPath(WHERE_CONDITION)) { + String where_condition = connectorConfig.getString(WHERE_CONDITION); + if (where_condition != null && !where_condition.isEmpty()) { + sql = sql + " " + where_condition; + connectorConfig = connectorConfig.withoutPath(WHERE_CONDITION); + } } connectorConfig =