!76 issues-I4IJ6V: Hive的Float类型转换其他数据库类型数据过长问题

* Merge branch 'master' from dev
* issues-I4IJ6V: Hive的Float类型转换其他数据库类型数据过长问题
This commit is contained in:
inrgihc
2022-02-11 04:16:46 +00:00
parent e691159876
commit 2b696bd372

View File

@@ -356,12 +356,21 @@ public class ColumnMetaData {
}
}
// If we're dealing with Hive and double precision types
if (desc.getDbType() == DatabaseTypeEnum.HIVE && type == java.sql.Types.DOUBLE
&& precision >= 15
&& length >= 15) {
precision = 6;
length = 25;
// If we're dealing with Hive and double/float precision types
if (desc.getDbType() == DatabaseTypeEnum.HIVE) {
if (type == java.sql.Types.DOUBLE
&& precision >= 15
&& length >= 15) {
precision = 6;
length = 25;
}
if (type == java.sql.Types.FLOAT
&& precision >= 7
&& length >= 7) {
precision = 6;
length = 25;
}
}
// if the length or precision needs a BIGNUMBER