This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1eb929e1ca [Bugfix](Jdbc Catalog) fix data type mapping of SQLServer
Catalog (#19525)
1eb929e1ca is described below
commit 1eb929e1caede071eb82d0ef19f7bb36911bb609
Author: Tiewei Fang <[email protected]>
AuthorDate: Wed May 17 21:02:42 2023 +0800
[Bugfix](Jdbc Catalog) fix data type mapping of SQLServer Catalog (#19525)
We map `money/smallmoney` types of SQLSERVER into decimal type of doris.
---
docs/en/docs/lakehouse/multi-catalog/jdbc.md | 4 +++-
docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md | 4 +++-
.../src/main/java/org/apache/doris/external/jdbc/JdbcClient.java | 4 +++-
.../data/jdbc_catalog_p0/test_sqlserver_jdbc_catalog.out | 6 +++---
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/docs/en/docs/lakehouse/multi-catalog/jdbc.md
b/docs/en/docs/lakehouse/multi-catalog/jdbc.md
index 7307149764..ccefe84e64 100644
--- a/docs/en/docs/lakehouse/multi-catalog/jdbc.md
+++ b/docs/en/docs/lakehouse/multi-catalog/jdbc.md
@@ -379,7 +379,9 @@ The transaction mechanism ensures the atomicity of data
writing to JDBC External
| int | INT |
|
| bigint | BIGINT |
|
| real | FLOAT |
|
-| float/money/smallmoney | DOUBLE |
|
+| float | DOUBLE |
|
+| money | DECIMAL(19,4) | |
+| smallmoney | DECIMAL(10,4) | |
| decimal/numeric | DECIMAL |
|
| date | DATE |
|
| datetime/datetime2/smalldatetime | DATETIMEV2 |
|
diff --git a/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
b/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
index c0d3c31fd6..192dc99a27 100644
--- a/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
+++ b/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
@@ -378,7 +378,9 @@ set enable_odbc_transcation = true;
| int | INT | |
| bigint | BIGINT | |
| real | FLOAT | |
-| float/money/smallmoney | DOUBLE | |
+| float | DOUBLE | |
+| money | DECIMAL(19,4) | |
+| smallmoney | DECIMAL(10,4) | |
| decimal/numeric | DECIMAL | |
| date | DATE | |
| datetime/datetime2/smalldatetime | DATETIMEV2 | |
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 b14a03167a..535d7daf4f 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
@@ -798,9 +798,11 @@ public class JdbcClient {
case "real":
return Type.FLOAT;
case "float":
+ return Type.DOUBLE;
case "money":
+ return ScalarType.createDecimalV3Type(19, 4);
case "smallmoney":
- return Type.DOUBLE;
+ return ScalarType.createDecimalV3Type(10, 4);
case "decimal":
case "numeric":
int precision = fieldSchema.getColumnSize();
diff --git
a/regression-test/data/jdbc_catalog_p0/test_sqlserver_jdbc_catalog.out
b/regression-test/data/jdbc_catalog_p0/test_sqlserver_jdbc_catalog.out
index 3768e8b9a6..4a9ca0ff32 100644
--- a/regression-test/data/jdbc_catalog_p0/test_sqlserver_jdbc_catalog.out
+++ b/regression-test/data/jdbc_catalog_p0/test_sqlserver_jdbc_catalog.out
@@ -30,9 +30,9 @@
4 2023-01-17 16:49:05 2023-01-17T16:49:05
2023-01-17T16:49:05 2023-01-17T16:49 2023-01-17 16:49:05 +08:00
-- !test6 --
-1 9.223372036854776E14 214748.3647
-2 -9.223372036854776E14 -214748.3648
-3 123.123 123.123
+1 922337203685477.5807 214748.3647
+2 -922337203685477.5808 -214748.3648
+3 123.1230 123.1230
-- !test7 --
1 12345678901234567890123456789012345678
12345678901234567890123456789012345678 1234567890123456789012345678.0123456789
1234567890123456789012345678.0123456789
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]