eldenmoon commented on code in PR #46639:
URL: https://github.com/apache/doris/pull/46639#discussion_r1909685546


##########
fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java:
##########
@@ -523,6 +523,48 @@ public boolean isDecimalV3OrContainsDecimalV3() {
         return false;
     }
 
+    // This method defines the char type
+    // to support the schema-change behavior of length growth.
+    public boolean isSupportSchemaChangeForCharType(Type other) throws 
TypeException {
+        if ((this.getPrimitiveType() == PrimitiveType.VARCHAR && 
other.getPrimitiveType() == PrimitiveType.VARCHAR) || (
+                this.getPrimitiveType() == PrimitiveType.CHAR && 
other.getPrimitiveType() == PrimitiveType.VARCHAR) || (
+                this.getPrimitiveType() == PrimitiveType.CHAR && 
other.getPrimitiveType() == PrimitiveType.CHAR)) {
+            if (this.getLength() > other.getLength()) {
+                throw new TypeException("Cannot shorten string length");
+            } else {
+                return true;

Review Comment:
   not return boolean value, just throw the ddl exception should be enough?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to