[Fix](Nereids) fix create table as select of view with unknowed length character type (#25471)
Problem: when create table as select from a view with unknown length character type, be would return an error of inserting data failed Example: doris/regression-test/suites/ddl_p0/test_ctas.groovy Reason & Solved: BE can not derive varchar length automaticly so FE should tell BE to maximize the size of varchar type
This commit is contained in:
@ -108,8 +108,8 @@ public class CreateTableCommand extends Command implements ForwardWithSync {
|
||||
} else if (i == 0 && dataType.isStringType()) {
|
||||
dataType = VarcharType.createVarcharType(ScalarType.MAX_VARCHAR_LENGTH);
|
||||
} else if (dataType instanceof CharacterType) {
|
||||
// if column is not come from column, we should set varchar length to max
|
||||
if (((CharacterType) dataType).getLen() > 0 && !s.isColumnFromTable()) {
|
||||
// if column is not come from table, we should set varchar length to max
|
||||
if (!s.isColumnFromTable()) {
|
||||
dataType = VarcharType.createVarcharType(ScalarType.MAX_VARCHAR_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user