MCPcopy Create free account
hub / github.com/apache/impala / DictionaryInt32Decode

Function DictionaryInt32Decode

be/src/gutil/strings/serialize.cc:271–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271bool DictionaryInt32Decode(unordered_map<string, int32>* dictionary,
272 const string& encoded_str) {
273 vector<pair<string, string> > items;
274 if (!DictionaryParse(encoded_str, &items))
275 return false;
276
277 dictionary->clear();
278 for (const auto& item : items) {
279 char *error = nullptr;
280 const int32 value = strto32(item.second.c_str(), &error, 0);
281 if (error == item.second.c_str() || *error != '\0') {
282 // parsing error
283 return false;
284 }
285 (*dictionary)[item.first] = value;
286 }
287 return true;
288}
289
290bool DictionaryInt64Decode(unordered_map<string, int64>* dictionary,
291 const string& encoded_str) {

Callers

nothing calls this directly

Calls 3

DictionaryParseFunction · 0.85
strto32Function · 0.85
clearMethod · 0.65

Tested by

no test coverage detected