You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/13 15:23:15 UTC
[doris] 02/09: [FixBug](jdbc Catalog) fix sqlserver column type mapping (#18518)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
commit d3731904c7903d8c2f25551438cf853637c79beb
Author: Tiewei Fang <43...@users.noreply.github.com>
AuthorDate: Wed Apr 12 19:58:30 2023 +0800
[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.
---
.../src/main/java/org/apache/doris/external/jdbc/JdbcClient.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java b/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
index fb5c6dd23c..ffeec31e20 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
@@ -706,7 +706,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;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org