Utilities for exporting Errow arrays to the Apache Arrow C Data Interface specification.
This allows zero-copy consumption by external native libraries such as:
- DuckDB (
duckdb_arrow_scan) - Polars / arrow-rs (
arrow::ffi::ArrowArray) - PyArrow (
pyarrow.Array._import_from_c) - Custom NIFs in C, Rust, or Zig
Summary
Functions
Exports the raw memory buffers ready to be passed to NIFs or Arrow C Data Interface.
Generates the Arrow C Schema metadata map for an array.
Functions
Exports the raw memory buffers ready to be passed to NIFs or Arrow C Data Interface.
Returns a map with:
:length- Number of elements.:null_count- Number of null values.:buffers- List of binaries padded to 8-byte boundaries as per Arrow spec:- For
Errow.String/Errow.Binary:[validity, offsets, data] - For
Errow.Numeric:[validity, data]
- For
Generates the Arrow C Schema metadata map for an array.
Returns a map containing:
:format- The Arrow C format string (e.g."u","z","i","l","g","d:38,0","w:32").:name- Column name (defaults to empty string"").:flags- Integer bitfield (2for nullable).:n_buffers- Count of buffers expected (2for primitives,3for variable-length binaries/strings).