Unverified Commit cb1cae2b authored by Aitongong's avatar Aitongong Committed by GitHub

fix:修复类型强转成string类型异常 (#1879)

Co-authored-by: 's avatarczx-Adam <chenzexu@mysteel.com>
parent 7223d3c5
......@@ -69,7 +69,7 @@ public class ObjectConvertUtil {
return Instant.ofEpochMilli((long) value).atZone(sinkTimeZone).toLocalDateTime();
}
} else if (logicalType instanceof DecimalType) {
return new BigDecimal((String) value);
return new BigDecimal(String.valueOf(value));
} else if (logicalType instanceof BigIntType) {
if (value instanceof Integer) {
return ((Integer) value).longValue();
......
......@@ -69,7 +69,7 @@ public class ObjectConvertUtil {
return Instant.ofEpochMilli((long) value).atZone(sinkTimeZone).toLocalDateTime();
}
} else if (logicalType instanceof DecimalType) {
return new BigDecimal((String) value);
return new BigDecimal(String.valueOf(value));
} else if (logicalType instanceof BigIntType) {
if (value instanceof Integer) {
return ((Integer) value).longValue();
......
......@@ -69,7 +69,7 @@ public class ObjectConvertUtil {
return Instant.ofEpochMilli((long) value).atZone(sinkTimeZone).toLocalDateTime();
}
} else if (logicalType instanceof DecimalType) {
return new BigDecimal((String) value);
return new BigDecimal(String.valueOf(value));
} else if (logicalType instanceof BigIntType) {
if (value instanceof Integer) {
return ((Integer) value).longValue();
......
......@@ -69,7 +69,7 @@ public class ObjectConvertUtil {
return Instant.ofEpochMilli((long) value).atZone(sinkTimeZone).toLocalDateTime();
}
} else if (logicalType instanceof DecimalType) {
return new BigDecimal((String) value);
return new BigDecimal(String.valueOf(value));
} else if (logicalType instanceof BigIntType) {
if (value instanceof Integer) {
return ((Integer) value).longValue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment