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

Method UnifyChunkedArray

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

Source from the content-addressed store, hash-verified

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