[FixBug](jdbc Catalog) fix sqlserver column type mapping (#18518)

For type int identity of sqlserver, the column type read from JDBC is called int indentity. So we need deal with this case.
This commit is contained in:
Tiewei Fang
2023-04-12 19:58:30 +08:00
committed by GitHub
parent edbe3e40b3
commit 3cf4f49444

View File

@ -711,7 +711,10 @@ public class JdbcClient {
}
public Type sqlserverTypeToDoris(JdbcFieldSchema fieldSchema) {
String sqlserverType = fieldSchema.getDataTypeName();
String originSqlserverType = fieldSchema.getDataTypeName();
// For sqlserver IDENTITY type, such as 'INT IDENTITY'
// originSqlserverType is "int identity", so we only get "int".
String sqlserverType = originSqlserverType.split(" ")[0];
switch (sqlserverType) {
case "bit":
return Type.BOOLEAN;