diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java index b3544b4de55460..5b943907db8f68 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java @@ -6486,11 +6486,7 @@ private static void getTableMeta(OlapTable olapTable, TGetMetaDBMeta dbMeta) { long partitionId = partition.getId(); partitionMeta.setId(partitionId); partitionMeta.setName(partition.getName()); - String partitionRange = ""; - if (tblPartitionInfo.getType() == PartitionType.RANGE - || tblPartitionInfo.getType() == PartitionType.LIST) { - partitionRange = tblPartitionInfo.getItem(partitionId).getItems().toString(); - } + String partitionRange = tblPartitionInfo.getPartitionRangeString(partitionId); partitionMeta.setRange(partitionRange); partitionMeta.setVisibleVersion(partition.getVisibleVersion()); // partitionMeta.setTemp(partition.isTemp()); diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/ListPartitionItem.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/ListPartitionItem.java index dba109a9539876..98585381244325 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/ListPartitionItem.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/ListPartitionItem.java @@ -61,7 +61,12 @@ public List getItems() { } public String getItemsString() { - return toString(); + // ATTN: DO NOT EDIT unless unless you explicitly guarantee compatibility + // between different versions. + // + // the ccr syncer depends on this string to identify partitions between two + // clusters (cluster versions may be different). + return getItems().toString(); } public String getItemsSql() { @@ -173,11 +178,6 @@ public int hashCode() { @Override public String toString() { - // ATTN: DO NOT EDIT unless unless you explicitly guarantee compatibility - // between different versions. - // - // the ccr syncer depends on this string to identify partitions between two - // clusters (cluster versions may be different). StringBuilder builder = new StringBuilder(); builder.append("partitionKeys: ["); for (PartitionKey partitionKey : partitionKeys) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/RangePartitionItem.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/RangePartitionItem.java index 690ab88991bd16..96bf0097c28a51 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/RangePartitionItem.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/RangePartitionItem.java @@ -46,7 +46,12 @@ public Range getItems() { } public String getItemsString() { - return toString(); + // ATTN: DO NOT EDIT unless unless you explicitly guarantee compatibility + // between different versions. + // + // the ccr syncer depends on this string to identify partitions between two + // clusters (cluster versions may be different). + return partitionKeyRange.toString(); } public String getItemsSql() { @@ -125,11 +130,6 @@ public boolean equals(Object obj) { @Override public String toString() { - // ATTN: DO NOT EDIT unless unless you explicitly guarantee compatibility - // between different versions. - // - // the ccr syncer depends on this string to identify partitions between two - // clusters (cluster versions may be different). return partitionKeyRange.toString(); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/proc/EsPartitionsProcDir.java b/fe/fe-core/src/main/java/org/apache/doris/common/proc/EsPartitionsProcDir.java index 87e7fa449f13a2..ed5cfc18d13e48 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/proc/EsPartitionsProcDir.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/proc/EsPartitionsProcDir.java @@ -93,7 +93,7 @@ public ProcResult fetchResult() throws AnalysisException { } partitionInfo.add(joiner.join(colNames)); // partition key partitionInfo.add( - rangePartitionInfo.getItem(esShardPartitions.getPartitionId()).getItems().toString()); // range + rangePartitionInfo.getItem(esShardPartitions.getPartitionId()).getItemsString()); // range partitionInfo.add("-"); // dis partitionInfo.add(esShardPartitions.getShardRoutings().size()); // shards partitionInfo.add(1); // replica num diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/proc/PartitionsProcDir.java b/fe/fe-core/src/main/java/org/apache/doris/common/proc/PartitionsProcDir.java index 3c44874cb7deff..3ac8b797d64ad6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/proc/PartitionsProcDir.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/proc/PartitionsProcDir.java @@ -323,7 +323,7 @@ private List, TRow>> getPartitionInfosInrernal() throws An String colNamesStr = joiner.join(colNames); partitionInfo.add(colNamesStr); trow.addToColumnValue(new TCell().setStringVal(colNamesStr)); - String itemStr = tblPartitionInfo.getItem(partitionId).getItems().toString(); + String itemStr = tblPartitionInfo.getPartitionRangeString(partitionId); partitionInfo.add(itemStr); trow.addToColumnValue(new TCell().setStringVal(itemStr)); } else {