| 136 | } |
| 137 | |
| 138 | void 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 | |
| 161 | bool DictionaryStructure::hasAttribute(const std::string & attribute_name) const |
| 162 | { |
no test coverage detected