roseduan commented on code in PR #155: URL: https://github.com/apache/flink-connector-jdbc/pull/155#discussion_r1945887068
########## flink-connector-jdbc-postgres/src/main/java/org/apache/flink/connector/jdbc/postgres/database/dialect/PostgresDialect.java: ########## @@ -73,17 +74,22 @@ public Optional<String> getUpsertStatement( Arrays.stream(uniqueKeyFields) .map(this::quoteIdentifier) .collect(Collectors.joining(", ")); + final Set<String> uniqueKeyFieldsSet = new HashSet<>(Arrays.asList(uniqueKeyFields)); String updateClause = Arrays.stream(fieldNames) + .filter(f -> !uniqueKeyFieldsSet.contains(f)) .map(f -> quoteIdentifier(f) + "=EXCLUDED." + quoteIdentifier(f)) .collect(Collectors.joining(", ")); + String conflictAction = + updateClause.isEmpty() + ? " DO NOTHING" + : String.format(" DO UPDATE SET %s", updateClause); Review Comment: OK, fixed. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org