gong commented on code in PR #6595:
URL: https://github.com/apache/inlong/pull/6595#discussion_r1029180297


##########
inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/dialect/ClickHouseDialect.java:
##########
@@ -129,22 +135,40 @@ public List<LogicalTypeRoot> unsupportedTypes() {
     @Override
     public String getUpdateStatement(
             String tableName, String[] fieldNames, String[] conditionFields) {
+        List<String> conditionFieldList = Arrays.asList(conditionFields);
         String setClause =
                 Arrays.stream(fieldNames)
+                        .filter(fieldName -> 
!conditionFieldList.contains(fieldName))
                         .map(f -> format("%s = :%s", quoteIdentifier(f), f))
                         .collect(Collectors.joining(", "));
+
         String conditionClause =
                 Arrays.stream(conditionFields)
                         .map(f -> format("%s = :%s", quoteIdentifier(f), f))
                         .collect(Collectors.joining(" AND "));
+        Pair<String, String> databaseAndTableName = 
getDatabaseAndTableName(tableName);
         return "ALTER TABLE "
-                + quoteIdentifier(tableName)
+                + quoteIdentifier(databaseAndTableName.getLeft())
+                + POINT
+                + quoteIdentifier(databaseAndTableName.getRight())
                 + " UPDATE "
                 + setClause
                 + " WHERE "
                 + conditionClause;
     }
 
+    private Pair<String, String> getDatabaseAndTableName(String tableName) {

Review Comment:
   ok



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