fix(sync): 修复decimal字段为空时抛出异常 使用返回null替代

This commit is contained in:
2024-03-04 11:07:50 +08:00
parent 396bc01f94
commit 6a0bbf3344

View File

@@ -133,6 +133,9 @@ public class TypeConverterV2 implements TypeConverter {
} else {
for (Schema type : schema.getTypes()) {
if (type.getLogicalType() instanceof LogicalTypes.Decimal) {
if (StrUtil.isBlankIfStr(value)) {
return null;
}
LogicalTypes.Decimal decimalType = (LogicalTypes.Decimal) type.getLogicalType();
int precision = decimalType.getPrecision();
int scala = decimalType.getScale();