| 1260 | } |
| 1261 | |
| 1262 | Status RoundtripBatch(const std::shared_ptr<RecordBatch>& batch, |
| 1263 | std::shared_ptr<RecordBatch>* out) { |
| 1264 | ARROW_ASSIGN_OR_RAISE(auto out_stream, io::BufferOutputStream::Create()); |
| 1265 | RETURN_NOT_OK(ipc::WriteRecordBatchStream({batch}, ipc::IpcWriteOptions::Defaults(), |
| 1266 | out_stream.get())); |
| 1267 | |
| 1268 | ARROW_ASSIGN_OR_RAISE(auto complete_ipc_stream, out_stream->Finish()); |
| 1269 | |
| 1270 | io::BufferReader reader(complete_ipc_stream); |
| 1271 | std::shared_ptr<RecordBatchReader> batch_reader; |
| 1272 | ARROW_ASSIGN_OR_RAISE(batch_reader, ipc::RecordBatchStreamReader::Open(&reader)); |
| 1273 | RETURN_NOT_OK(batch_reader->ReadNext(out)); |
| 1274 | return Status::OK(); |
| 1275 | } |
| 1276 | |
| 1277 | } // namespace test |
| 1278 | } // namespace ipc |
no test coverage detected