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 7293816617ba61df96f464c6d9916f7ea48f42d2
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 3c2606194f..4b7a73d8eb 100644
--- a/docs/en/docs/lakehouse/multi-catalog/jdbc.md
+++ b/docs/en/docs/lakehouse/multi-catalog/jdbc.md
@@ -376,7 +376,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 78292960ff..b8f52431a5 100644
--- a/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
+++ b/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
@@ -375,7 +375,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 f0981b4e09..690cfebf53 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
@@ -750,9 +750,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]

Reply via email to