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

Function ImportChunked

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

Source from the content-addressed store, hash-verified

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

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