Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down