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

Function ipc___SerializeRecordBatch__Raw

r/src/recordbatch.cpp:164–181  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

162
163// [[arrow::export]]
164cpp11::raws ipc___SerializeRecordBatch__Raw(
165 const std::shared_ptr<arrow::RecordBatch>& batch) {
166 // how many bytes do we need ?
167 int64_t size;
168 StopIfNotOk(arrow::ipc::GetRecordBatchSize(*batch, &size));
169
170 // allocate the result raw vector
171 cpp11::writable::raws out(size);
172
173 // serialize into the bytes of the raw vector
174 auto buffer = std::make_shared<arrow::r::RBuffer<cpp11::raws>>(out);
175 arrow::io::FixedSizeBufferWriter stream(buffer);
176 StopIfNotOk(arrow::ipc::SerializeRecordBatch(
177 *batch, arrow::ipc::IpcWriteOptions::Defaults(), &stream));
178 StopIfNotOk(stream.Close());
179
180 return out;
181}
182
183// [[arrow::export]]
184std::shared_ptr<arrow::RecordBatch> ipc___ReadRecordBatch__InputStream__Schema(

Calls 5

StopIfNotOkFunction · 0.85
GetRecordBatchSizeFunction · 0.85
SerializeRecordBatchFunction · 0.50
DefaultsFunction · 0.50
CloseMethod · 0.45

Tested by

no test coverage detected