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

Method Compact

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

Source from the content-addressed store, hash-verified

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