If type is not nullable, wrap it to be nullable
| 132 | |
| 133 | /// If type is not nullable, wrap it to be nullable |
| 134 | static DataTypePtr tryMakeNullableForMapValue(const DataTypePtr & type) |
| 135 | { |
| 136 | if (type->isNullable()) |
| 137 | return type; |
| 138 | /// When type is low cardinality, its dictionary type must be nullable, see more detail in DataTypeLowCardinality::canBeByteMapValueType() |
| 139 | if (const auto * low_cardinality_type = typeid_cast<const DataTypeLowCardinality *>(type.get())) |
| 140 | { |
| 141 | if (const auto * nullable_type = typeid_cast<const DataTypeNullable *>(low_cardinality_type->getDictionaryType().get())) |
| 142 | return type; |
| 143 | else |
| 144 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Can not get map implicit column data type of lowcardinality type."); |
| 145 | } |
| 146 | else |
| 147 | { |
| 148 | if (type->canBeInsideNullable()) |
| 149 | return makeNullable(type); |
| 150 | else |
| 151 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Can not get map implicit column data type of type {}.", type->getName()); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | DataTypePtr DataTypeMap::getValueTypeForImplicitColumn() const |
| 156 | { |
no test coverage detected