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

Method Make

cpp/src/arrow/chunked_array.cc:65–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65Result<std::shared_ptr<ChunkedArray>> ChunkedArray::Make(ArrayVector chunks,
66 std::shared_ptr<DataType> type) {
67 if (type == nullptr) {
68 if (chunks.size() == 0) {
69 return Status::Invalid(
70 "cannot construct ChunkedArray from empty vector "
71 "and omitted type");
72 }
73 type = chunks[0]->type();
74 }
75 for (const auto& chunk : chunks) {
76 if (!chunk->type()->Equals(*type)) {
77 return Status::TypeError("Array chunks must all be same type");
78 }
79 }
80 return std::make_shared<ChunkedArray>(std::move(chunks), std::move(type));
81}
82
83Result<std::shared_ptr<ChunkedArray>> ChunkedArray::MakeEmpty(
84 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