diff --git a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/LabelGenerator.java b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/LabelGenerator.java index 637c96918..7e58bb810 100644 --- a/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/LabelGenerator.java +++ b/flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/LabelGenerator.java @@ -56,10 +56,13 @@ public String generateTableLabel(long chkId) { String label = String.format("%s_%s_%s_%s", labelPrefix, tableIdentifier, subtaskId, chkId); if (enable2PC) { return label; - } else if (LABEL_PATTERN.matcher(label).matches()) { - return label + "_" + UUID.randomUUID(); } else { - return String.format("%s_%s_%s_%s", labelPrefix, subtaskId, chkId, UUID.randomUUID()); + label = label + "_" + UUID.randomUUID(); + if (LABEL_PATTERN.matcher(label).matches()) { + return label; + } else { + return labelPrefix + "_" + subtaskId + "_" + chkId + "_" + UUID.randomUUID(); + } } }