Open-Source Wikis

/

Apache Arrow

/

Implementations

/

C++

apache/arrow

C++

Active contributors: Antoine Pitrou, Rossi Sun, Sutou Kouhei, Felipe Aramburu, William Ayd

The C++ library at cpp/src/ is the core of this repository. Every other component in this repo — PyArrow, the R package, c_glib, Red Arrow, MATLAB, Parquet, Gandiva, the dataset framework, Acero, Flight — builds on top of it.

Purpose

Provide a high-performance reference implementation of the Arrow columnar format and an ecosystem of analytics building blocks: array types, IO, filesystems, IPC, compute kernels, query execution, RPC, and adapters to popular file formats.

Top-level layout

cpp/
├── CMakeLists.txt          # Top-level CMake
├── CMakePresets.json       # Build presets
├── meson.build             # Optional Meson build
├── README.md               # Pointer to docs
├── src/
│   ├── arrow/              # The Arrow core library (libarrow)
│   ├── parquet/            # Parquet C++ (libparquet)
│   ├── gandiva/            # Gandiva LLVM JIT (libgandiva)
│   └── generated/          # FlatBuffers + Thrift outputs (DO NOT EDIT BY HAND)
├── examples/               # Standalone examples (datasets, parquet, flight, gandiva)
├── thirdparty/             # Vendored / fetched third-party deps
├── cmake_modules/          # Project CMake macros & finders
├── build-support/          # Lint, format, IWYU, release helpers
├── tools/                  # Misc CLI tools
├── apidoc/                 # Doxygen configuration
├── valgrind.supp           # Valgrind suppressions
├── gdb_arrow.py            # GDB pretty-printers for Arrow types
└── Brewfile / vcpkg.json   # macOS / Windows dep manifests

The arrow/ subdirectory

cpp/src/arrow/ is the heart of the C++ library. It's organized by subsystem:

cpp/src/arrow/
├── array/        # Array hierarchy: builders, immutable arrays, slicing
├── compute/      # Function registry + kernels
├── csv/          # CSV reader and writer
├── json/         # JSON reader
├── io/           # Streams, files, compression
├── filesystem/   # FileSystem abstraction (local, S3, GCS, Azure, HDFS)
├── ipc/          # IPC reader/writer + Feather V1
├── flight/       # Flight RPC + Flight SQL
├── dataset/      # Multi-file/format datasets
├── acero/        # Streaming execution engine
├── engine/       # Substrait adapter
├── extension/    # Built-in extension types (UUID, JSON, OpaqueType, ...)
├── adapters/     # ORC and TensorFlow adapters
├── c/            # C data interface bridge + DLPack
├── gpu/          # CUDA support
├── tensor/       # Sparse tensor I/O
├── integration/  # Cross-language test runner
├── testing/      # Test fixtures shared across the suite
├── util/         # Bit utils, threading, logging, telemetry, vendored helpers
├── vendored/     # Vendored small third-party libraries
└── *.cc / *.h    # Top-level concepts: Buffer, Status, Result, RecordBatch, Table, Schema, Type

The vendored/ subdirectory holds small, infrequently changing third-party code that's compiled into Arrow rather than fetched as a dependency. Examples: xxhash, datetime (Howard Hinnant), fast_float, double-conversion, pcg.

Key abstractions

Type Header Purpose
arrow::Buffer cpp/src/arrow/buffer.h Reference-counted byte range.
arrow::MemoryPool cpp/src/arrow/memory_pool.h Allocator interface.
arrow::Status cpp/src/arrow/status.h Error type returned everywhere.
arrow::Result<T> cpp/src/arrow/result.h Status-or-T.
arrow::DataType cpp/src/arrow/type.h Logical type.
arrow::Field, arrow::Schema cpp/src/arrow/type.h Names + types + metadata.
arrow::Array, arrow::ArrayBuilder cpp/src/arrow/array/array_base.h Immutable column / mutable builder.
arrow::ArrayData cpp/src/arrow/array/data.h Physical buffers + metadata.
arrow::ChunkedArray cpp/src/arrow/chunked_array.h Logical column made of one or more chunks.
arrow::RecordBatch cpp/src/arrow/record_batch.h Schema + equal-length arrays.
arrow::Table cpp/src/arrow/table.h Schema + chunked arrays.
arrow::Datum cpp/src/arrow/datum.h Union type for compute inputs/outputs.

Build system

The canonical build is CMake:

  • Top-level cpp/CMakeLists.txt orchestrates everything.
  • Per-subsystem CMakeLists.txt builds individual libraries (e.g. cpp/src/arrow/dataset/CMakeLists.txt).
  • Component-level toggles: ARROW_PARQUET, ARROW_FLIGHT, ARROW_GANDIVA, ARROW_DATASET, ARROW_S3, ARROW_PYTHON, ...
  • A Meson alternative exists under cpp/meson.build and is occasionally used for distros that prefer Meson.

cpp/CMakePresets.json exposes named build flavors. cpp/cmake_modules/ holds the project's CMake macros.

Integration points

  • PyArrow links against libarrow.so and re-exports the API in Python via Cython.
  • R arrow links against libarrow.so via cpp11.
  • C-GLib wraps it with GObject classes.
  • MATLAB uses MEX shims.
  • External engines (DuckDB, Polars, DataFusion) consume Arrow data through the C data interface, which is in cpp/src/arrow/c/.

Where to start reading

Question Start at
What does an Arrow array look like? cpp/src/arrow/array/data.h and cpp/src/arrow/array/array_base.h
How do types work? cpp/src/arrow/type.h
How does compute dispatch work? cpp/src/arrow/compute/function.h, kernel.h, registry.h
How does Acero schedule work? cpp/src/arrow/acero/exec_plan.h
How is a Parquet file read? cpp/src/parquet/file_reader.h
How does the IPC reader work? cpp/src/arrow/ipc/reader.h

For deep dives, see the Systems section.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

C++ – Apache Arrow wiki | Factory