MCPcopy Create free account
hub / github.com/apache/orc / insert

Method insert

c++/src/Dictionary.cc:39–51  ·  view source on GitHub ↗

insert a new string into dictionary, return its insertion order

Source from the content-addressed store, hash-verified

37
38 // insert a new string into dictionary, return its insertion order
39 size_t SortedStringDictionary::insert(const char* str, size_t len) {
40 size_t index = keyToIndex_.size();
41
42 auto it = keyToIndex_.find(std::string_view{str, len});
43 if (it != keyToIndex_.end()) {
44 return it->second;
45 } else {
46 auto s = Arena::Create<std::string>(arena_.get(), str, len);
47 keyToIndex_.emplace(std::string_view{s->data(), s->length()}, index);
48 totalLength_ += len;
49 return index;
50 }
51 }
52
53 // reserve space for dictionary entries
54 void SortedStringDictionary::reserve(size_t size) {

Callers 15

merge_prFunction · 0.45
decodeRLEv2Function · 0.45
assertNoSharedNodesFunction · 0.45
SchemaEvolutionMethod · 0.45
seekToRowGroupMethod · 0.45
startNextStripeMethod · 0.45
getColumnIdsFunction · 0.45
addMethod · 0.45
mergeGeometryInternalMethod · 0.45
mergeGeometryTypesMethod · 0.45
mergeMethod · 0.45

Calls 5

lengthMethod · 0.80
sizeMethod · 0.65
endMethod · 0.65
getMethod · 0.45
dataMethod · 0.45

Tested by 2

decodeRLEv2Function · 0.36
assertNoSharedNodesFunction · 0.36