MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / create

Function create

src/DataTypes/DataTypeFixedString.cpp:65–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64
65static DataTypePtr create(const ASTPtr & arguments)
66{
67 if (!arguments || arguments->children.size() != 1)
68 throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH,
69 "FixedString data type family must have exactly one argument - size in bytes");
70
71 const auto * argument = arguments->children[0]->as<ASTLiteral>();
72 if (!argument || argument->value.getType() != Field::Types::UInt64 || argument->value.safeGet<UInt64>() == 0)
73 throw Exception(ErrorCodes::UNEXPECTED_AST_STRUCTURE,
74 "FixedString data type family must have a number (positive integer) as its argument");
75
76 return std::make_shared<DataTypeFixedString>(argument->value.safeGet<UInt64>());
77}
78
79
80void registerDataTypeFixedString(DataTypeFactory & factory)

Callers 2

createColumnMethod · 0.70
doGetSerializationMethod · 0.70

Calls 3

ExceptionClass · 0.50
sizeMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected