# Apache Arrow

**Apache Arrow** 是一个开源软件项目，它定义了一种标准化、与语言无关的列式内存格式，适用于扁平与嵌套的表格数据，并配套提供多语言库集合，用于快速数据交换与内存分析。<sup>[1](https://arrow.apache.org/)</sup><sup> • </sup><sup>[2](https://arrow.apache.org/overview/)</sup> 该格式规定了每一列的各个值如何在连续内存中排布，使得过滤、分组、聚合等分析操作能够高效运行，也使数据得以在系统之间移动而无需序列化开销。<sup>[3](https://arrow.apache.org/docs/format/Intro.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 一种与语言无关的列式内存格式，面向扁平与嵌套数据，其组织方式便于在现代硬件（如 CPU 和 GPU）上高效执行分析操作<sup>[1](https://arrow.apache.org/)</sup> |
| 项目时间 | 首次 git 提交为 2016 年 2 月 5 日；首个版本 0.1.0 于 2016 年 10 月 7 日打标签<sup>[4](https://arrow.apache.org/blog/2026/02/12/arrow-anniversary/)</sup> |
| 治理 | 2016 年 2 月 17 日宣布为 Apache 软件基金会顶级项目；最初由 Apache Drill 项目的代码孵化而来<sup>[5](https://news.apache.org/foundation/entry/the_apache_software_foundation_announces87)</sup> |
| 格式版本 | 列式格式规范版本 1.5，除游程编码数组为 O(log n) 外，随机访问为 O(1)<sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup> |
| 元数据 | 使用 Google 的 Flatbuffers 序列化；与 Apache Parquet 不同，Arrow 的类型系统没有物理类型与逻辑类型的区分<sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup> |
| 库 | 在 C、C++、.NET、Go、Java、JavaScript、Julia、MATLAB、Python、R、Ruby、Rust 和 Swift 中有官方实现，另有轻量级子项目 nanoarrow<sup>[7](https://arrow.apache.org/docs/dev/implementations.html)</sup> |
| 最新版本 | 26.0.0，发布于 2026 年 10 月 9 日<sup>[8](https://arrow.apache.org/release/)</sup> |

## 为什么需要列式内存格式

表格数据在内存中可以按行存储，也可以按列存储。在列式布局中，每一列的各个值位于连续内存之中，这改善了分析操作期间的内存局部性，并使之能够向量化：大多数现代 CPU 都具备 SIMD 指令，即一条指令同时作用于多个值，从而对向量数据并行执行。<sup>[3](https://arrow.apache.org/docs/format/Intro.html)</sup> 高性能分析数据库、数据仓库和查询引擎——如 [Amazon Redshift](https://www.edgepedia.org/zh/amazon-redshift)、Apache DataFusion、ClickHouse、DuckDB、Google BigQuery 和 [Snowflake](https://www.edgepedia.org/zh/snowflake-inc)——都已趋同于列式架构，因为它能加速最常见的几类分析查询。<sup>[9](https://arrow.apache.org/blog/2025/01/10/arrow-result-transfer/)</sup>

**交换问题。** 如果没有标准的列式数据格式，每个数据库和语言都实现自己的内部数据格式，在系统之间移动数据就需要昂贵的序列化与反序列化。Arrow 项目的 FAQ 指出，在分析型工作负载中，序列化开销往往可占计算成本的 80% 到 90%，而同时使用或支持 Arrow 的系统之间传输数据几乎不产生成本。<sup>[10](https://github.com/apache/arrow-site/blob/main/faq.md)</sup> 该格式的设计在特定技术意义上使这一点成为可能：缓冲区无需“指针重定位”（pointer swizzling）即可迁移，从而在共享内存中实现真正的零拷贝访问；消息只需检查消息元数据即可“反序列化”为内存中的 Arrow 数组，无需复制或移动实际数据。<sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup>

权衡在规范本身中已有说明：列式格式提供分析性能与数据局部性保证，代价是变更操作相对更为昂贵。<sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup>

## 列式格式

Arrow 列式格式由三部分组成：与语言无关的内存数据结构规范、元数据序列化，以及用于序列化和通用数据传输的协议。<sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup> 其关键特性包括：数据相邻性以支持顺序访问（扫描）、常数时间随机访问、对 SIMD 和向量化友好，以及零拷贝可迁移性。<sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup>

核心术语很简洁。每一列是一个数组（在某些实现中称为向量），即一段已知长度、类型相同的值的序列；单个逻辑值称为槽（slot）；缓冲区（buffer）是存储数组数据的一块连续内存区域。一个数组由一个或多个缓冲区组成，而某一给定类型的值在内存中如何排布的规定，就是它的物理内存布局。<sup>[3](https://arrow.apache.org/docs/format/Intro.html)</sup>

**空值处理。** Arrow 支持所有数据类型（原始类型或嵌套类型）的缺失值。一个专用缓冲区——有效性位图或空值位图——为每个槽记录一位：置位表示该值非空，未置位表示该值为空。该位图是可选的；不含空值的数组无需分配它。空值计数为零的数组可以省略位图，而消费方必须能处理这两种情况。<sup>[11](https://arrow.apache.org/docs/format/Columnar.html)</sup><sup> • </sup><sup>[3](https://arrow.apache.org/docs/format/Intro.html)</sup>

**布局。** 规范定义了一族物理布局：定长原始类型布局（例如，一个 int32 数组由有效性位图加一个连续的值缓冲区构成）、带偏移缓冲区的变长二进制布局、用于嵌套序列的列表与列表视图布局、有效性为结构体位图与其子位图逻辑与的结构体布局、稠密与稀疏联合布局（稠密联合每个值带 5 字节开销）、以字典整数索引表示重复值的字典编码布局，以及面向长游程数据的游程编码布局。<sup>[11](https://arrow.apache.org/docs/format/Columnar.html)</sup> 建议缓冲区按 8 或 64 字节的倍数对齐与填充，在进程间通信序列化时则强制执行；首选 64 字节对齐。<sup>[11](https://arrow.apache.org/docs/format/Columnar.html)</sup>

元数据与数据分开处理：各实现可以按自己的方式在内存中表示元数据，序列化则使用 Google 的 Flatbuffers 项目，内置数据类型列于 Schema.fbs 协议定义文件中。<sup>[11](https://arrow.apache.org/docs/format/Columnar.html)</sup><sup> • </sup><sup>[6](https://arrow.apache.org/docs/22.0/format/Columnar.html)</sup>

## 序列化、IPC 与 Flight

除内存布局之外，Arrow 还定义了一种 IPC（进程间通信）格式，包含流式变体与文件变体。文件格式支持随机访问：它以魔字符串 `ARROW1` 开头和结尾，末尾是一个页脚，其中包含模式副本以及每个数据块的内存偏移与大小，从而可以随机访问文件中的任意记录批次。推荐的文件扩展名为：流用 `.arrows`，文件用 `.arrow`，二者均已在 IANA 注册媒体类型。<sup>[12](https://github.com/apache/arrow/blob/main/docs/source/format/Columnar.rst)</sup><sup> • </sup><sup>[10](https://github.com/apache/arrow-site/blob/main/faq.md)</sup>

**Arrow Flight** 是一个基于 gRPC 和 IPC 格式构建的 RPC 框架，用于高性能数据服务。它围绕从服务下载或上传到服务的 Arrow 记录批次流来组织，配有用于发现与自省的元数据方法，并支持应用自定义方法。方法与线格式由 Protobuf 定义，认证选项包括基于头部的中间件与双向 TLS。<sup>[13](https://arrow.apache.org/docs/format/Flight.html)</sup> 一项关于 [Arrow Flight](https://www.edgepedia.org/zh/arrow-flight) 的基准研究将其描述为用于数据传输、查询与微服务的线速协议，能够以与平台和语言无关的方式在网络上并行传输 Arrow RecordBatch。<sup>[14](https://arxiv.org/abs/2204.03032)</sup>

该项目还维护 ADBC（Arrow Database Connectivity），这是一套由 Arrow 驱动的 API 与驱动集合，用于访问数据库和查询引擎；此外还有 C 数据接口，用于跨语言运行时零拷贝共享 Arrow 数据。<sup>[15](https://github.com/apache/arrow)</sup>

## 实现与生态系统

官方库在 C、C++、.NET、Go、Java、JavaScript、Julia、MATLAB、Python、R、Ruby、Rust 和 Swift 中实现了该格式；C GLib、MATLAB、Python、R 和 Ruby 库构建于 C++ 实现之上，各不同实现之间进行集成测试，以确保对格式的忠实性。<sup>[7](https://arrow.apache.org/docs/dev/implementations.html)</sup><sup> • </sup><sup>[2](https://arrow.apache.org/overview/)</sup> 这些库还涵盖对 CSV、Apache ORC 和 [Apache Parquet](https://www.edgepedia.org/zh/apache-parquet) 等文件格式的读写、零拷贝共享内存与基于 RPC 的数据移动，以及内存分析与查询处理。<sup>[3](https://arrow.apache.org/docs/format/Intro.html)</sup>

**与 Parquet 的关系。** Arrow 的设计初衷是作为 Parquet 的内存对应物，后者是一种用于持久化存储的列式格式：Apache Parquet 项目的几位创始人也参与了 Arrow 的早期设计讨论，意图让内存格式解决互操作性挑战的另一半。<sup>[4](https://arrow.apache.org/blog/2026/02/12/arrow-anniversary/)</sup> 一项对 Arrow、Parquet 和 ORC 的研究比较发现，每种格式各有取舍，使其在分析型 DBMS 中的适用程度有所不同：Arrow 着眼于原始读取性能，而 Parquet 和 ORC 则通过更重的编码着眼于磁盘上的大小。<sup>[16](https://arxiv.org/abs/2411.14331)</sup>

下游系统将 Arrow 用作通用数据层。DuckDB 提供与 Arrow 的零拷贝数据集成，可在 Python 和 R 中快速分析超出内存的数据集，同时利用 DuckDB 的并行向量化执行而无需额外的数据复制。<sup>[17](https://duckdb.org/2021/12/03/duck-arrow)</sup> Arrow C++ 库本身提供一个查询引擎，支持查询结果流式输出、列表/结构体/映射等高效复杂类型，以及投影下推与过滤下推等扫描优化。<sup>[17](https://duckdb.org/2021/12/03/duck-arrow)</sup>

## 历史与社区

Apache 软件基金会于 2016 年 2 月 17 日宣布 Arrow 成为顶级项目，将其描述为面向列式内存分析的高性能跨系统数据层，最初由 [Apache Drill](https://www.edgepedia.org/zh/apache-drill) 项目的代码孵化而来。启动时的提交者包括来自 Apache 大数据项目的开发者，涉及 Calcite、Cassandra、Drill、Hadoop、HBase、Impala、Kudu、Parquet、Phoenix、Spark 和 Storm，以及 Pandas 和 Ibis；Pandas 的创造者[韦斯·麦金尼](https://www.edgepedia.org/zh/wes-mckinney)（Wes McKinney）是早期领导者之一。<sup>[5](https://news.apache.org/foundation/entry/the_apache_software_foundation_announces87)</sup> 首个版本 0.1.0 于 2016 年 10 月 7 日打标签，当时就已具备此后构成大多数 Arrow 数据集基础的主要数据类型。<sup>[4](https://arrow.apache.org/blog/2026/02/12/arrow-anniversary/)</sup>

项目稳步成长。Apache 软件基金会董事会报告记录，截至 2025 年 7 月有 115 名提交者和 58 名 PMC 成员，而 2020 年 1 月为 50 名提交者和 28 名 PMC 成员，项目状态报告为持续进行且活跃度高。<sup>[18](https://www.apache.org/foundation/board/minutes/Arrow.html)</sup> 近期版本按规律节奏发布，26.0.0 于 2026 年 10 月 9 日发布。<sup>[8](https://arrow.apache.org/release/)</sup> 格式本身被认为已经稳定，项目打算只做向后兼容的更改，例如增加新的数据类型。<sup>[10](https://github.com/apache/arrow-site/blob/main/faq.md)</sup>

## References

1. [Apache Arrow homepage](https://arrow.apache.org/)
2. [Apache Arrow Overview](https://arrow.apache.org/overview/)
3. [Introduction, Apache Arrow format documentation](https://arrow.apache.org/docs/format/Intro.html)
4. [Apache Arrow is 10 years old, Apache Arrow blog](https://arrow.apache.org/blog/2026/02/12/arrow-anniversary/)
5. [The Apache Software Foundation Announces Apache Arrow as a Top-Level Project, ASF Blog](https://news.apache.org/foundation/entry/the_apache_software_foundation_announces87)
6. [Arrow Columnar Format, Apache Arrow v22.0.0 documentation](https://arrow.apache.org/docs/22.0/format/Columnar.html)
7. [Implementations, Apache Arrow documentation](https://arrow.apache.org/docs/dev/implementations.html)
8. [Apache Arrow Releases](https://arrow.apache.org/release/)
9. [How the Apache Arrow Format Accelerates Query Result Transfer, Apache Arrow blog](https://arrow.apache.org/blog/2025/01/10/arrow-result-transfer/)
10. [Apache Arrow FAQ, apache/arrow-site on GitHub](https://github.com/apache/arrow-site/blob/main/faq.md)
11. [Arrow Columnar Format, Apache Arrow v25.0.1 documentation](https://arrow.apache.org/docs/format/Columnar.html)
12. [arrow/docs/source/format/Columnar.rst, apache/arrow on GitHub](https://github.com/apache/arrow/blob/main/docs/source/format/Columnar.rst)
13. [Arrow Flight RPC, Apache Arrow v25.0.1 documentation](https://arrow.apache.org/docs/format/Flight.html)
14. [Benchmarking Apache Arrow Flight: A wire-speed protocol for data transfer, querying and microservices, arXiv](https://arxiv.org/abs/2204.03032)
15. [apache/arrow on GitHub](https://github.com/apache/arrow)
16. [Data Formats in Analytical DBMSs: Performance Trade-offs and Future Directions, arXiv](https://arxiv.org/abs/2411.14331)
17. [DuckDB Quacks Arrow: A Zero-Copy Data Integration between Apache Arrow and DuckDB, DuckDB blog](https://duckdb.org/2021/12/03/duck-arrow)
18. [Board history: Arrow, Apache Software Foundation](https://www.apache.org/foundation/board/minutes/Arrow.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Data formats and serialization

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/apache-arrow

English original: https://www.edgepedia.org/apache-arrow
