MCPcopy Create free account
hub / github.com/ByConity/ByConity / registerDataType

Method registerDataType

src/DataTypes/DataTypeFactory.cpp:177–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175
176
177void DataTypeFactory::registerDataType(const String & family_name, Value creator, CaseSensitiveness case_sensitiveness)
178{
179 if (creator == nullptr)
180 throw Exception("DataTypeFactory: the data type family " + family_name + " has been provided "
181 " a null constructor", ErrorCodes::LOGICAL_ERROR);
182
183 String family_name_lowercase = Poco::toLower(family_name);
184
185 if (isAlias(family_name) || isAlias(family_name_lowercase))
186 throw Exception("DataTypeFactory: the data type family name '" + family_name + "' is already registered as alias",
187 ErrorCodes::LOGICAL_ERROR);
188
189 if (!data_types.emplace(family_name, creator).second)
190 throw Exception("DataTypeFactory: the data type family name '" + family_name + "' is not unique",
191 ErrorCodes::LOGICAL_ERROR);
192
193
194 if (case_sensitiveness == CaseInsensitive
195 && !case_insensitive_data_types.emplace(family_name_lowercase, creator).second)
196 throw Exception("DataTypeFactory: the case insensitive data type family name '" + family_name + "' is not unique",
197 ErrorCodes::LOGICAL_ERROR);
198}
199
200void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator creator, CaseSensitiveness case_sensitiveness)
201{

Callers 14

registerDataTypeArrayFunction · 0.80
registerDataTypeNumbersFunction · 0.80
registerDataTypeStringFunction · 0.80
registerDataTypeTimeFunction · 0.80
registerDataTypeDateTimeFunction · 0.80
registerDataTypeEnumFunction · 0.80
registerDataTypeDecimalFunction · 0.80
registerDataTypeObjectFunction · 0.80
registerDataTypeTupleFunction · 0.80
registerDataTypeMapFunction · 0.80
registerDataTypeNullableFunction · 0.80

Calls 3

isAliasFunction · 0.85
ExceptionClass · 0.50
emplaceMethod · 0.45

Tested by

no test coverage detected