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 b5004973c37f1c..5ec6a60c8dd845 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 @@ -101,8 +101,11 @@ public void checkDistribution(DistributionInfo distributionInfo) throws DdlExcep continue; } if (!targetColType.equals(info.getDistributionColumns().get(i).getType())) { + String typeName = info.getDistributionColumns().get(i).getType().toString(); + String colName = info.getDistributionColumns().get(i).getName(); + String formattedString = colName + "(" + typeName + ")"; ErrorReport.reportDdlException(ErrorCode.ERR_COLOCATE_TABLE_MUST_HAS_SAME_DISTRIBUTION_COLUMN_TYPE, - info.getDistributionColumns().get(i).getName(), targetColType); + formattedString, targetColType); } } } diff --git a/fe/fe-core/src/test/java/org/apache/doris/catalog/ColocateTableTest.java b/fe/fe-core/src/test/java/org/apache/doris/catalog/ColocateTableTest.java index 7e0e2baacda6b8..cf3ddbf69c069d 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/catalog/ColocateTableTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/ColocateTableTest.java @@ -310,7 +310,7 @@ public void testDistributionColumnsType() throws Exception { + ");"); expectedEx.expect(DdlException.class); - expectedEx.expectMessage("Colocate tables distribution columns must have the same data type: k2 should be INT"); + expectedEx.expectMessage("Colocate tables distribution columns must have the same data type: k2(VARCHAR(10)) should be INT"); createTable("create table " + dbName + "." + tableName2 + " (\n" + " `k1` int NULL COMMENT \"\",\n" + " `k2` varchar(10) NULL COMMENT \"\"\n"