yiguolei commented on a change in pull request #8142:
URL: https://github.com/apache/incubator-doris/pull/8142#discussion_r810117793
##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java
##########
@@ -386,6 +386,14 @@ public void checkSchemaChangeAllowed(Column other) throws
DdlException {
throw new DdlException("Can not change " + getDataType() + " to "
+ other.getDataType());
}
+ if (type.isNumericType() && other.type.isStringType()) {
+ Integer lSize = type.getColumnStringRepSize();
+ Integer rSize = other.type.getColumnStringRepSize();
+ if (rSize < lSize) {
+ throw new DdlException("Can not change from wider type to
narrower type");
Review comment:
BE should also have a similar mechanism to check the type length during
a schema change. It should fail the alter task in BE not crash.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]