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


##########
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:
   I'm curious is this a bug or performance improvement?
   
   Also cc @RocMarshal , would you mind reviewing this PR as well (as you are 
the active contributor of jdbc connector)?



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