This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new e4c7d4d03ac [chore](error msg) print type info when colocate with ddl
failed due to type mismatch (#28773)
e4c7d4d03ac is described below
commit e4c7d4d03ac3d01a43ec7d4ec35d125aacba19f5
Author: zhiqiang <[email protected]>
AuthorDate: Fri Dec 22 12:48:20 2023 +0800
[chore](error msg) print type info when colocate with ddl failed due to
type mismatch (#28773)
---
.../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 57d512b9789..32c48c5fba0 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 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 8e13b1467ee..4ea69f03945 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]