Hello,

I have a RecordBatch that I would like to write to a file. I'm using
FileOutputStream::Open to open the file and RecordBatchStreamWriter::Open
to open the stream. I write a record batch with WriteRecordBatch. Finally,
I close the RecordBatchWriter and OutputStream.

The resulting file size is exactly the size of the Buffer used to store the
RecordBatch. It looks like it is missing the schema. When I try to open the
resulting file from PyArrow I get:

>>> pa.ipc.open_file('/tmp/1')
pyarrow.lib.ArrowInvalid: File is too small: 6

$ ll /tmp/1
-rw-r--r--. 1 root root 720 Jun 15 03:54 /tmp/1

How can I write the schema as well?

I was browsing the documentation at
https://arrow.apache.org/docs/cpp/index.html but I can't locate any C++
documentation about RecordBatchStreamWriter or RecordBatchWriter. Is this
intentional?

Thank you!
Rares

Reply via email to