mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Fix issue with nullables
This commit is contained in:
parent
97ea093073
commit
655262d1a1
@ -1547,11 +1547,13 @@ DataTypePtr makeNullableRecursively(DataTypePtr type)
|
||||
DataTypes nested_types;
|
||||
for (const auto & nested_type: variant_type->getVariants())
|
||||
{
|
||||
/// unlike tuple or array, here we do not want to make any of the variants nullable
|
||||
/// so we do not call makeNullableRecursively
|
||||
nested_types.push_back(nested_type);
|
||||
auto is_low_cardinality = nested_type->lowCardinality();
|
||||
auto has_sub_types = nested_type->haveSubtypes();
|
||||
if (!is_low_cardinality && has_sub_types)
|
||||
nested_types.push_back(makeNullableRecursively(nested_type));
|
||||
else
|
||||
nested_types.push_back(nested_type);
|
||||
}
|
||||
|
||||
return std::make_shared<DataTypeVariant>(nested_types);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user