| 195 | } |
| 196 | |
| 197 | static DataTypePtr create(const ASTPtr & arguments) |
| 198 | { |
| 199 | if (!arguments || arguments->children.size() != 2) |
| 200 | throw Exception("Map data type family must have two arguments: key and value types", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); |
| 201 | |
| 202 | DataTypes nested_types; |
| 203 | nested_types.reserve(arguments->children.size()); |
| 204 | |
| 205 | for (const ASTPtr & child : arguments->children) |
| 206 | nested_types.emplace_back(DataTypeFactory::instance().get(child)); |
| 207 | |
| 208 | return std::make_shared<DataTypeMap>(nested_types); |
| 209 | } |
| 210 | |
| 211 | void registerDataTypeMap(DataTypeFactory & factory) |
| 212 | { |
no test coverage detected