Small improvement

This commit is contained in:
kssenii 2021-06-03 11:31:02 +00:00
parent b209893cd1
commit a2997535e1

View File

@ -286,8 +286,8 @@ public:
serialize = [&](size_t col_idx, const Array & values) serialize = [&](size_t col_idx, const Array & values)
{ {
const auto & type = values_types[col_idx]; const auto & type = values_types[col_idx];
if (isInteger(type)) if (!type->isNullable())
SerializationNumber<Int64>().serializeBinary(values[col_idx], buf); type->promoteNumericType()->getDefaultSerialization()->serializeBinary(values[col_idx], buf);
else else
values_serializations[col_idx]->serializeBinary(values[col_idx], buf); values_serializations[col_idx]->serializeBinary(values[col_idx], buf);
}; };
@ -325,8 +325,8 @@ public:
deserialize = [&](size_t col_idx, Array & values) deserialize = [&](size_t col_idx, Array & values)
{ {
const auto & type = values_types[col_idx]; const auto & type = values_types[col_idx];
if (isInteger(type)) if (!type->isNullable())
SerializationNumber<Int64>().deserializeBinary(values[col_idx], buf); type->promoteNumericType()->getDefaultSerialization()->deserializeBinary(values[col_idx], buf);
else else
values_serializations[col_idx]->deserializeBinary(values[col_idx], buf); values_serializations[col_idx]->deserializeBinary(values[col_idx], buf);
}; };