From 24c1bf5804ea5260687814a006cb4d6eeb61178d Mon Sep 17 00:00:00 2001 From: wudi <676366545@qq.com> Date: Mon, 2 Dec 2024 14:05:03 +0800 Subject: [PATCH] update --- .../apache/doris/flink/sink/writer/LabelGenerator.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 5207b3ca5..225446859 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 @@ -54,11 +54,17 @@ public LabelGenerator(String labelPrefix, boolean enable2PC, int subtaskId) { public String generateTableLabel(long chkId) { Preconditions.checkState(tableIdentifier != null); String label = String.format("%s_%s_%s_%s", labelPrefix, tableIdentifier, subtaskId, chkId); + + String uuid = UUID.randomUUID().toString().replace("-", ""); + if (!enable2PC) { + label = label + "_" + uuid; + } + if (LABEL_PATTERN.matcher(label).matches()) { + // The unicode table name or length exceeds the limit return label; } - // The unicode table name or length exceeds the limit - String uuid = UUID.randomUUID().toString().replace("-", ""); + if (enable2PC) { // In 2pc, replace uuid with the table name. This will cause some txns to fail to be // aborted when aborting.