[fix](broker load) improve the checking of overlapping partitions of same table (#32254)

This commit is contained in:
meiyi
2024-03-19 22:06:38 +08:00
committed by yiguolei
parent 2196c534e8
commit 7484a7ba5f
3 changed files with 187 additions and 0 deletions

View File

@ -175,6 +175,20 @@ public class BrokerFileGroupAggInfo implements Writable {
public void addFileGroup(BrokerFileGroup fileGroup) throws DdlException {
FileGroupAggKey fileGroupAggKey = new FileGroupAggKey(fileGroup.getTableId(), fileGroup.getPartitionIds());
List<BrokerFileGroup> fileGroupList = aggKeyToFileGroups.get(fileGroupAggKey);
// check if there are overlapping of table with partitions and table without partitions of same table
if (fileGroup.getPartitionIds() == null) {
for (FileGroupAggKey groupAggKey : aggKeyToFileGroups.keySet()) {
if (groupAggKey.tableId == fileGroup.getTableId() && !groupAggKey.partitionIds.isEmpty()) {
throw new DdlException("There are overlapping partitions of same table"
+ " in data description of load job stmt");
}
}
} else {
if (aggKeyToFileGroups.containsKey(new FileGroupAggKey(fileGroup.getTableId(), null))) {
throw new DdlException("There are overlapping partitions of same table"
+ " in data description of load job stmt");
}
}
if (fileGroupList == null) {
// check if there are overlapping partitions of same table
if (tableIdToPartitionIds.containsKey(fileGroup.getTableId())