← All notes

Serialize Apache Arrow data as record batches in the columnar IPC stream

Answer: In Arrow, a record batch is the primitive unit used when serializing columnar data. It is an ordered collection of arrays, and the field names and types form that batch's schema. IPC writes those batches as binary payloads in a one-way stream.

Record batches and schema

A record batch is, semantically, an ordered collection of arrays known as fields. Those fields share a length, yet they may use different data types. The batch schema is the collective set of field names and types.

IPC defines a protocol that serializes record batches as binary payloads, then reconstructs them without copying memory. The stream is one-way and carries Schema, RecordBatch, and DictionaryBatch messages. A schema is an ordered sequence of fields, each with a name and a type.

| record batch | schema | |---|---| | ordered collection of arrays | field names and types | | Schema RecordBatch DictionaryBatch | message types in IPC | | IPC stream | Schema, then record batches |

Writing a stream

C++ exposes RecordBatchWriter as an abstract interface whose job is writing a stream of record batches. WriteRecordBatch appends one record batch onto that stream. The writer counts IPC messages written, record batches written, and dictionary batches written.

Raw size is the original buffer sizes. Serialized size includes padding and, optionally, compression. Closing the actual OutputStream is the user's responsibility.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Apache Arrow docs, Arrow Columnar Format; Apache Arrow source, writer.h (RecordBatchWriter). Apache-2.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Apache Arrow docs, Arrow Columnar Format; Apache Arrow source, writer.h (RecordBatchWriter). Apache-2.0.

Cite this

Permanent ID: iil:note:nb35nmjg

iinventedlight. 2026. "Serialize Apache Arrow data as record batches in the columnar IPC stream." iinventedlight Library, iil:note:nb35nmjg, version of 2026-11-20. https://iinventedlight.com/library/notes/arrow-record-batches/. License: CC-BY-4.0.

@misc{iil_note_nb35nmjg,
  author = {{iinventedlight}},
  title = {{Serialize Apache Arrow data as record batches in the columnar IPC stream}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-20},
  url = {https://iinventedlight.com/library/notes/arrow-record-batches/},
  note = {Permanent ID iil:note:nb35nmjg. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/arrow-record-batches.md.