diff --git a/ydb/core/scheme/scheme_types_proto.cpp b/ydb/core/scheme/scheme_types_proto.cpp index 4c0ce3b99fc3..6f49d36fec4a 100644 --- a/ydb/core/scheme/scheme_types_proto.cpp +++ b/ydb/core/scheme/scheme_types_proto.cpp @@ -42,11 +42,15 @@ TTypeInfoMod TypeInfoModFromProtoColumnType(ui32 typeId, const NKikimrProto::TTy return res; } case NTypeIds::Decimal: { - Y_ABORT_UNLESS(typeInfo, "no type info for decimal type"); - TTypeInfoMod res = { - .TypeInfo = {{typeInfo->GetDecimalPrecision(), typeInfo->GetDecimalScale()}}, - .TypeMod = {} - }; + ui32 precision, scale; + if (!typeInfo) { + precision = DECIMAL_PRECISION; + scale = DECIMAL_SCALE; + } else { + precision = typeInfo->GetDecimalPrecision(); + scale = typeInfo->GetDecimalScale(); + } + TTypeInfoMod res = {{TDecimalType(precision, scale)}, {}}; return res; } default: { diff --git a/ydb/core/tx/datashard/datashard_user_table.cpp b/ydb/core/tx/datashard/datashard_user_table.cpp index ed34187ae9d4..c173ba884130 100644 --- a/ydb/core/tx/datashard/datashard_user_table.cpp +++ b/ydb/core/tx/datashard/datashard_user_table.cpp @@ -266,17 +266,8 @@ void TUserTable::ParseProto(const NKikimrSchemeOp::TTableDescription& descr) for (const auto& col : descr.GetColumns()) { TUserColumn& column = Columns[col.GetId()]; if (column.Name.empty()) { - std::optional typeInfo; - if (col.HasTypeInfo()) { - typeInfo = col.GetTypeInfo(); - } else if (col.GetTypeId() == NScheme::NTypeIds::Decimal) { - // Migration from table with no decimal typeInfo - typeInfo = NKikimr::NScheme::DefaultDecimalProto(); - } else { - typeInfo = {}; - } - - auto typeInfoMod = NScheme::TypeInfoModFromProtoColumnType(col.GetTypeId(), typeInfo ? &*typeInfo : nullptr); + auto typeInfoMod = NScheme::TypeInfoModFromProtoColumnType(col.GetTypeId(), + col.HasTypeInfo() ? &col.GetTypeInfo() : nullptr); column = TUserColumn(typeInfoMod.TypeInfo, typeInfoMod.TypeMod, col.GetName()); } column.Family = col.GetFamily();