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

Method DoLargeRoundTrip

cpp/src/arrow/ipc/read_write_test.cc:448–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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());

Callers

nothing calls this directly

Calls 7

ZeroMemoryMapFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
getMethod · 0.45
SeekMethod · 0.45
WriteRecordBatchMethod · 0.45
CloseMethod · 0.45
ReadRecordBatchMethod · 0.45

Tested by

no test coverage detected