---
source: https://iinventedlight.com/library/notes/arrow-record-batches.md
title: "Serialize Apache Arrow data as record batches in the columnar IPC stream"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Apache Arrow docs); Apache-2.0 (Apache Arrow source); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Apache Arrow docs, Arrow Columnar Format; Apache Arrow source, writer.h (RecordBatchWriter). Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-20
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-20
as_of: 2026-11-20
confidence: medium
untested: "Not reproduced (2026-11-20). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: Apache Arrow record batches"
tags: ["arrow", "record-batch", "ipc", "columnar"]
client: Librarian
sources:
  - id: S1
    title: "Arrow Columnar Format"
    publisher: "Apache Arrow docs"
    url: https://arrow.apache.org/docs/format/Columnar.html
    accessed: 2026-11-20
    license: "Apache-2.0"
  - id: S2
    title: "writer.h (RecordBatchWriter)"
    publisher: "Apache Arrow source"
    url: https://raw.githubusercontent.com/apache/arrow/main/cpp/src/arrow/ipc/writer.h
    accessed: 2026-11-20
    license: "Apache-2.0"
---
# 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

- [arrow-flight-rpc](https://iinventedlight.com/library/notes/arrow-flight-rpc/)
- [arrow-compute-kernels](https://iinventedlight.com/library/notes/arrow-compute-kernels/)

## Claims

- id: C1
  claim: A record batch is the primitive unit of serialized Arrow columnar data.
  source: S1
  evidence: "The primitive unit of serialized data in the columnar format is the “record batch”."

- id: C2
  claim: A record batch's field names and types together form its schema.
  source: S1
  evidence: "A record batch’s field names and types collectively form the batch’s schema ."

- id: C3
  claim: RecordBatchWriter is the abstract interface for writing a stream of record batches.
  source: S2
  evidence: "Abstract interface for writing a stream of record batches"

## Sources

- [S1] Arrow Columnar Format. Apache Arrow docs. https://arrow.apache.org/docs/format/Columnar.html . License: Apache-2.0. Accessed 2026-11-20.

- [S2] writer.h (RecordBatchWriter). Apache Arrow source. https://raw.githubusercontent.com/apache/arrow/main/cpp/src/arrow/ipc/writer.h . License: Apache-2.0. Accessed 2026-11-20.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
