| 446 | } |
| 447 | |
| 448 | Result<std::shared_ptr<RecordBatch>> DoLargeRoundTrip(const RecordBatch& batch, |
| 449 | bool zero_data) { |
| 450 | if (zero_data) { |
| 451 | RETURN_NOT_OK(ZeroMemoryMap(mmap_.get())); |
| 452 | } |
| 453 | RETURN_NOT_OK(mmap_->Seek(0)); |
| 454 | |
| 455 | auto options = options_; |
| 456 | options.allow_64bit = true; |
| 457 | |
| 458 | ARROW_ASSIGN_OR_RAISE(auto file_writer, |
| 459 | MakeFileWriter(mmap_, batch.schema(), options)); |
| 460 | RETURN_NOT_OK(file_writer->WriteRecordBatch(batch)); |
| 461 | RETURN_NOT_OK(file_writer->Close()); |
| 462 | |
| 463 | ARROW_ASSIGN_OR_RAISE(int64_t offset, mmap_->Tell()); |
| 464 | |
| 465 | std::shared_ptr<RecordBatchFileReader> file_reader; |
| 466 | ARROW_ASSIGN_OR_RAISE(file_reader, RecordBatchFileReader::Open(mmap_.get(), offset)); |
| 467 | |
| 468 | return file_reader->ReadRecordBatch(0); |
| 469 | } |
| 470 | |
| 471 | void CheckReadResult(const RecordBatch& result, const RecordBatch& expected) { |
| 472 | ASSERT_OK(result.ValidateFull()); |
nothing calls this directly
no test coverage detected