[Fix](Planner) fix varchar does not show real length (#25171)

Problem:
when we create table with datatype varchar(), we regard it to be max length by default. But when we desc, it does not show
real length but show varchar()
Reason:
when we upgrade version from 2.0.1 to 2.0.2, we support new feature of creating varchar(), and it shows the same way with
ddl schema. So user would confuse of the length of varchar
Solved:
change the showing of varchar() to varchar(65533), which in compatible with hive
This commit is contained in:
LiBinfeng
2023-11-14 10:49:21 +08:00
committed by GitHub
parent e0934166f5
commit 0a9d71ebd2
21 changed files with 43 additions and 30 deletions

View File

@ -598,7 +598,7 @@ public class ScalarType extends Type {
return "TIMEV2(" + scale + ")";
} else if (type == PrimitiveType.VARCHAR) {
if (isWildcardVarchar()) {
return "VARCHAR(*)";
return "VARCHAR(" + MAX_VARCHAR_LENGTH + ")";
}
return "VARCHAR(" + len + ")";
} else if (type == PrimitiveType.STRING) {