This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 9e4aec38901 [chore](error msg) print type info when colocate with ddl 
failed due to type mismatch (#28773) (#28905)
9e4aec38901 is described below

commit 9e4aec3890193c3c46ab4f784ed2c186a1f46644
Author: zhiqiang <[email protected]>
AuthorDate: Sat Dec 23 09:23:39 2023 +0800

    [chore](error msg) print type info when colocate with ddl failed due to 
type mismatch (#28773) (#28905)
---
 .../src/main/java/org/apache/doris/catalog/ColocateGroupSchema.java  | 5 ++++-
 .../src/test/java/org/apache/doris/catalog/ColocateTableTest.java    | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

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 b5004973c37..5ec6a60c8dd 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 class ColocateGroupSchema implements Writable {
                     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 7e0e2baacda..cf3ddbf69c0 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 class ColocateTableTest {
                 + ");");
 
         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"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to