Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](catelog) Unifies partition items string #45669

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ public List<PartitionKey> 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() {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ public Range<PartitionKey> 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() {
Expand Down Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private List<Pair<List<Comparable>, 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 {
Expand Down
Loading