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

Function ImportChunked

cpp/src/arrow/c/bridge.cc:2484–2508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2482 IsDevice, internal::ArrayDeviceStreamExportTraits,
2483 internal::ArrayStreamExportTraits>>
2484Result<std::shared_ptr<ChunkedArray>> ImportChunked(
2485 typename StreamTraits::CType* stream,
2486 const DeviceMemoryMapper& mapper = DefaultDeviceMemoryMapper) {
2487 if (StreamTraits::IsReleasedFunc(stream)) {
2488 return Status::Invalid("Cannot import released Arrow Stream");
2489 }
2490
2491 auto reader = std::make_shared<ArrayStreamArrayReader<IsDevice>>(stream, mapper);
2492 ARROW_RETURN_NOT_OK(reader->Init());
2493
2494 auto data_type = reader->data_type();
2495 ArrayVector chunks;
2496 std::shared_ptr<Array> chunk;
2497 while (true) {
2498 ARROW_RETURN_NOT_OK(reader->ReadNext(&chunk));
2499 if (!chunk) {
2500 break;
2501 }
2502
2503 chunks.push_back(std::move(chunk));
2504 }
2505
2506 reader->ReleaseStream();
2507 return ChunkedArray::Make(std::move(chunks), std::move(data_type));
2508}
2509
2510} // namespace
2511

Callers

nothing calls this directly

Calls 7

push_backMethod · 0.80
ReleaseStreamMethod · 0.80
InvalidFunction · 0.50
MakeFunction · 0.50
InitMethod · 0.45
data_typeMethod · 0.45
ReadNextMethod · 0.45

Tested by

no test coverage detected