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

Method validateKeyTypes

src/Dictionaries/DictionaryStructure.cpp:138–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void DictionaryStructure::validateKeyTypes(const DataTypes & key_types) const
139{
140 auto key_attributes_types = getKeyTypes();
141 size_t key_attributes_types_size = key_attributes_types.size();
142
143 size_t key_types_size = key_types.size();
144 if (key_types_size != key_attributes_types_size)
145 throw Exception(ErrorCodes::TYPE_MISMATCH, "Key structure does not match, expected {}", getKeyDescription());
146
147 for (size_t i = 0; i < key_types_size; ++i)
148 {
149 const auto & expected_type = key_attributes_types[i];
150 const auto & actual_type = key_types[i];
151
152 if (!expected_type->equals(*actual_type))
153 throw Exception(ErrorCodes::TYPE_MISMATCH,
154 "Key type for complex key at position {} does not match, expected {}, found {}",
155 i,
156 expected_type->getName(),
157 actual_type->getName());
158 }
159}
160
161bool DictionaryStructure::hasAttribute(const std::string & attribute_name) const
162{

Callers 12

getColumnMethod · 0.80
hasKeysMethod · 0.80
getColumnMethod · 0.80
getColumnsMethod · 0.80
hasKeysMethod · 0.80
getColumnsImplMethod · 0.80
getColumnsMethod · 0.80
hasKeysMethod · 0.80
getColumnsMethod · 0.80
hasKeysMethod · 0.80
getColumnMethod · 0.80
hasKeysMethod · 0.80

Calls 4

ExceptionClass · 0.50
sizeMethod · 0.45
equalsMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected