MCPcopy Create free account
hub / github.com/apache/arrow / Compact

Method Compact

cpp/src/arrow/array/array_dict.cc:324–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324Result<std::shared_ptr<Array>> DictionaryArray::Compact(MemoryPool* pool) const {
325 std::shared_ptr<Array> compact_dictionary;
326 ARROW_ASSIGN_OR_RAISE(std::unique_ptr<Buffer> transpose_map,
327 CompactTransposeMap(this->data_, pool, compact_dictionary));
328
329 if (transpose_map == nullptr) {
330 return std::make_shared<DictionaryArray>(this->data_);
331 } else {
332 return this->Transpose(this->type(), compact_dictionary,
333 transpose_map->data_as<int32_t>(), pool);
334 }
335}
336
337// ----------------------------------------------------------------------
338// Dictionary unification

Callers 2

CheckDictionaryCompactFunction · 0.80
TESTFunction · 0.80

Calls 4

TransposeMethod · 0.95
CompactTransposeMapFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
typeMethod · 0.45

Tested by 2

CheckDictionaryCompactFunction · 0.64
TESTFunction · 0.64