Add nullability to type. Note: LowCardinality(T) transformed to LowCardinality(Nullable(T))
| 86 | /// Add nullability to type. |
| 87 | /// Note: LowCardinality(T) transformed to LowCardinality(Nullable(T)) |
| 88 | DataTypePtr convertTypeToNullable(const DataTypePtr & type) |
| 89 | { |
| 90 | if (isNullable(type)) |
| 91 | return type; |
| 92 | |
| 93 | if (const auto * low_cardinality_type = typeid_cast<const DataTypeLowCardinality *>(type.get())) |
| 94 | { |
| 95 | const auto & dict_type = low_cardinality_type->getDictionaryType(); |
| 96 | if (dict_type->canBeInsideNullable()) |
| 97 | return std::make_shared<DataTypeLowCardinality>(makeNullable(dict_type)); |
| 98 | } |
| 99 | |
| 100 | if (type->canBeInsideNullable()) |
| 101 | return makeNullable(type); |
| 102 | |
| 103 | return type; |
| 104 | } |
| 105 | |
| 106 | |
| 107 | DataTypePtr tryConvertTypeToNullable(const DataTypePtr & type) |
no test coverage detected