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

Function ImportChunked

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

Source from the content-addressed store, hash-verified

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

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