[[arrow::export]]
| 162 | |
| 163 | // [[arrow::export]] |
| 164 | cpp11::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]] |
| 184 | std::shared_ptr<arrow::RecordBatch> ipc___ReadRecordBatch__InputStream__Schema( |
no test coverage detected