Simplification of Nullable [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2017-12-07 07:12:40 +03:00
parent 8204d2cdfd
commit 8f248dd718
2 changed files with 1278 additions and 1278 deletions

View File

@ -64,12 +64,12 @@ DataTypePtr FieldToDataType::operator() (Array & x) const
for (Field & elem : x) for (Field & elem : x)
element_types.emplace_back(applyVisitor(FieldToDataType(), elem)); element_types.emplace_back(applyVisitor(FieldToDataType(), elem));
DataTypePtr res = std::make_shared<DataTypeArray>(getLeastCommonType(element_types)); DataTypePtr res = getLeastCommonType(element_types);
for (Field & elem : x) for (Field & elem : x)
elem = convertFieldToType(elem, *res); elem = convertFieldToType(elem, *res);
return res; return std::make_shared<DataTypeArray>(res);
} }