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

Method getValue

src/DataTypes/EnumValues.cpp:173–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172template <typename T>
173T EnumValues<T>::getValue(std::string_view field_name) const
174{
175 T x;
176 if (tryGetValue(x, field_name))
177 return x;
178
179 auto hints = this->getHints(std::string{field_name});
180 auto hints_string = !hints.empty() ? ", maybe you meant: " + toString(hints) : "";
181 throw Exception(ErrorCodes::UNKNOWN_ELEMENT_OF_ENUM, "Unknown element '{}' for enum{}", field_name, hints_string);
182}
183
184template <typename T>
185bool EnumValues<T>::findValueByName(std::string_view field_name, T & result) const

Callers 8

allChangedMethod · 0.45
castToNameMethod · 0.45
castToValueMethod · 0.45
deserializeTextQuotedMethod · 0.45
deserializeWholeTextMethod · 0.45
deserializeTextJSONMethod · 0.45
deserializeTextCSVMethod · 0.45

Calls 5

tryGetValueFunction · 0.85
toStringFunction · 0.50
ExceptionClass · 0.50
getHintsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected