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

Method UnifyChunkedArray

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

Source from the content-addressed store, hash-verified

524}
525
526Result<std::shared_ptr<ChunkedArray>> DictionaryUnifier::UnifyChunkedArray(
527 const std::shared_ptr<ChunkedArray>& array, MemoryPool* pool) {
528 if (array->num_chunks() <= 1) {
529 return array;
530 }
531
532 ArrayDataVector data_chunks(array->num_chunks());
533 std::transform(array->chunks().begin(), array->chunks().end(), data_chunks.begin(),
534 [](const std::shared_ptr<Array>& array) { return array->data(); });
535 ARROW_ASSIGN_OR_RAISE(bool changed,
536 RecursiveUnifier{pool}.Unify(array->type(), &data_chunks));
537 if (!changed) {
538 return array;
539 }
540 ArrayVector chunks(array->num_chunks());
541 std::transform(data_chunks.begin(), data_chunks.end(), chunks.begin(),
542 [](const std::shared_ptr<ArrayData>& data) { return MakeArray(data); });
543 return std::make_shared<ChunkedArray>(std::move(chunks), array->type());
544}
545
546Result<std::shared_ptr<Table>> DictionaryUnifier::UnifyTable(const Table& table,
547 MemoryPool* pool) {

Callers

nothing calls this directly

Calls 7

MakeArrayFunction · 0.70
num_chunksMethod · 0.45
beginMethod · 0.45
chunksMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected