diff --git a/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/executor/JdbcBatchStatementExecutorBuilder.java b/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/executor/JdbcBatchStatementExecutorBuilder.java index 301633fb1c5..5ca2e57b10b 100644 --- a/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/executor/JdbcBatchStatementExecutorBuilder.java +++ b/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/executor/JdbcBatchStatementExecutorBuilder.java @@ -57,8 +57,8 @@ private boolean supportReplacingMergeTreeTableUpsert() { private String[] getDefaultProjectionFields() { List fieldNames = Arrays.asList(rowType.getFieldNames()); - return clickhouseTableSchema.keySet().stream() - .filter(fieldNames::contains) + return fieldNames.stream() + .filter(clickhouseTableSchema::containsKey) .toArray(String[]::new); }