From c6aa4a6a3d56012e7751eae17c05eb64b7e4d7e1 Mon Sep 17 00:00:00 2001 From: wow_zx <48906844+wowzx@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:47:17 +0800 Subject: [PATCH] [Hotfix][connector-v2][clickhouse] Fixed an out-of-order BUG with output data fields of clickhouse-sink (#5346) --- .../client/executor/JdbcBatchStatementExecutorBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }