diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/ColocateGroupSchema.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/ColocateGroupSchema.java index 09e9437a35..b5004973c3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/ColocateGroupSchema.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/ColocateGroupSchema.java @@ -72,6 +72,11 @@ public class ColocateGroupSchema implements Writable { public void checkColocateSchema(OlapTable tbl) throws DdlException { checkDistribution(tbl.getDefaultDistributionInfo()); + // We add a table with many partitions to the colocate group, + // we need to check whether all partitions comply with the colocate group specification + for (Partition partition : tbl.getAllPartitions()) { + checkDistribution(partition.getDistributionInfo()); + } checkReplicaAllocation(tbl.getPartitionInfo()); }