refactor: 优化列式存储策略数字类型转换逻辑

This commit is contained in:
zhouhao 2024-11-06 15:50:59 +08:00
parent b5944c6d3a
commit d2772e8881
1 changed files with 3 additions and 2 deletions

View File

@ -102,8 +102,9 @@ public abstract class ColumnModeSaveOperationsBase extends AbstractSaveOperation
return value instanceof String ? String.valueOf(value) : ObjectMappers.toJsonString(value);
}
//数字类型直接返回
if (metadata.getValueType() instanceof NumberType && value instanceof Number) {
return convertNumberValue(((NumberType<?>) metadata.getValueType()), ((Number) value));
if (metadata.getValueType() instanceof NumberType) {
NumberType<?> type = ((NumberType<?>) metadata.getValueType());
return convertNumberValue(type, type.convertOriginalNumber(value));
}
if (metadata.getValueType() instanceof Converter) {
return ((Converter<?>) metadata.getValueType()).convert(value);