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

Method Make

cpp/src/arrow/chunked_array.cc:73–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73Result<std::shared_ptr<ChunkedArray>> ChunkedArray::Make(ArrayVector chunks,
74 std::shared_ptr<DataType> type) {
75 if (type == nullptr) {
76 if (chunks.size() == 0) {
77 return Status::Invalid(
78 "cannot construct ChunkedArray from empty vector "
79 "and omitted type");
80 }
81 type = chunks[0]->type();
82 }
83 for (const auto& chunk : chunks) {
84 if (!chunk->type()->Equals(*type)) {
85 return Status::TypeError("Array chunks must all be same type");
86 }
87 }
88 return std::make_shared<ChunkedArray>(std::move(chunks), std::move(type));
89}
90
91Result<std::shared_ptr<ChunkedArray>> ChunkedArray::MakeEmpty(
92 std::shared_ptr<DataType> type, MemoryPool* memory_pool) {

Callers

nothing calls this directly

Calls 5

InvalidFunction · 0.70
TypeErrorFunction · 0.70
sizeMethod · 0.45
typeMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected