1996fanrui commented on code in PR #108:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/108#discussion_r1615444568


##########
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/AbstractPostgresCompatibleDialect.java:
##########
@@ -50,12 +50,14 @@ public String getLimitClause(long limit) {
     @Override
     public Optional<String> getUpsertStatement(
             String tableName, String[] fieldNames, String[] uniqueKeyFields) {
+        Set<String> uniqueKeyFieldsSet = 
Arrays.stream(uniqueKeyFields).collect(Collectors.toSet());
         String uniqueColumns =
-                Arrays.stream(uniqueKeyFields)
+                uniqueKeyFieldsSet.stream()
                         .map(this::quoteIdentifier)
                         .collect(Collectors.joining(", "));
         String updateClause =
                 Arrays.stream(fieldNames)
+                        .filter(f -> !uniqueKeyFieldsSet.contains(f))

Review Comment:
   It's better to add a test to check it if it's a bug.



-- 
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]

Reply via email to