0xderek commented on code in PR #40122:
URL: https://github.com/apache/doris/pull/40122#discussion_r1759689926
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java:
##########
@@ -374,11 +377,11 @@ private Type dorisTypeToDoris(String type) {
return ScalarType.createDatetimeV2Type(scale);
}
case "CHAR":
- case "VARCHAR": {
- int length = Integer.parseInt(upperType.substring(openParen +
1, upperType.length() - 1));
- return baseType.equals("CHAR")
- ? ScalarType.createCharType(length) :
ScalarType.createVarcharType(length);
- }
+ ScalarType charType =
ScalarType.createType(PrimitiveType.CHAR);
+ charType.setLength(fieldSchema.getColumnSize().orElse(0));
+ return charType;
+ case "VARCHAR":
+ return
ScalarType.createVarcharType(fieldSchema.getColumnSize().orElse(0));
Review Comment:
Curious to know why do we set length to 0 when column size is not set?
--
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]