From ef5890db1070e4e54401f2c20073c4675f599cc2 Mon Sep 17 00:00:00 2001 From: zhiqiang-hhhh Date: Thu, 21 Dec 2023 14:03:01 +0800 Subject: [PATCH 1/2] message colocate --- .../java/org/apache/doris/catalog/ColocateGroupSchema.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 57d512b9789d9e..32c48c5fba07cd 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 @@ -105,8 +105,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); } } } From 8ecb8df051019c4b0510a2688351b96718aef431 Mon Sep 17 00:00:00 2001 From: zhiqiang-hhhh Date: Thu, 21 Dec 2023 14:34:26 +0800 Subject: [PATCH 2/2] modify FEUT --- .../test/java/org/apache/doris/catalog/ColocateTableTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8e13b1467ee7e0..4ea69f03945dcb 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"