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

Function SerializeRecordBatch

cpp/src/arrow/ipc/generate_fuzz_corpus.cc:106–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106Result<std::shared_ptr<Buffer>> SerializeRecordBatch(
107 const std::shared_ptr<RecordBatch>& batch, const IpcWriteOptions& options,
108 bool is_stream_format) {
109 ARROW_ASSIGN_OR_RAISE(auto sink, io::BufferOutputStream::Create(1024));
110 std::shared_ptr<RecordBatchWriter> writer;
111 if (is_stream_format) {
112 ARROW_ASSIGN_OR_RAISE(writer, MakeStreamWriter(sink, batch->schema(), options));
113 } else {
114 ARROW_ASSIGN_OR_RAISE(writer, MakeFileWriter(sink, batch->schema(), options));
115 }
116 RETURN_NOT_OK(writer->WriteRecordBatch(*batch));
117 RETURN_NOT_OK(writer->Close());
118 return sink->Finish();
119}
120
121Status DoMain(bool is_stream_format, const std::string& out_dir) {
122 ARROW_ASSIGN_OR_RAISE(auto dir_fn, PlatformFilename::FromString(out_dir));

Callers

nothing calls this directly

Calls 7

MakeStreamWriterFunction · 0.85
MakeFileWriterFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
schemaMethod · 0.45
WriteRecordBatchMethod · 0.45
CloseMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected