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

Method DoLargeRoundTrip

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

Source from the content-addressed store, hash-verified

442 }
443
444 Result<std::shared_ptr<RecordBatch>> DoLargeRoundTrip(const RecordBatch& batch,
445 bool zero_data) {
446 if (zero_data) {
447 RETURN_NOT_OK(ZeroMemoryMap(mmap_.get()));
448 }
449 RETURN_NOT_OK(mmap_->Seek(0));
450
451 auto options = options_;
452 options.allow_64bit = true;
453
454 ARROW_ASSIGN_OR_RAISE(auto file_writer,
455 MakeFileWriter(mmap_, batch.schema(), options));
456 RETURN_NOT_OK(file_writer->WriteRecordBatch(batch));
457 RETURN_NOT_OK(file_writer->Close());
458
459 ARROW_ASSIGN_OR_RAISE(int64_t offset, mmap_->Tell());
460
461 std::shared_ptr<RecordBatchFileReader> file_reader;
462 ARROW_ASSIGN_OR_RAISE(file_reader, RecordBatchFileReader::Open(mmap_.get(), offset));
463
464 return file_reader->ReadRecordBatch(0);
465 }
466
467 void CheckReadResult(const RecordBatch& result, const RecordBatch& expected) {
468 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