Expand description
std.arrow — Apache Arrow RecordBatch as a first-class Value.
This module is the runtime side of #426. Construction builtins
(arrow.from_int_columns, …) take Lex List[Int] / List[Float] /
List[Str] columns and pack them into a flat RecordBatch; numeric
reductions (arrow.col_sum_int, arrow.col_mean, …) run as a single
Rust call over the underlying buffer, bypassing the bytecode VM for
the inner loop.
The only Value shape leaving this module that touches the Arrow
dependency is Value::ArrowTable(Arc<RecordBatch>). Everything else
is plain Lex values.
Functions§
- dispatch
- Dispatch an
arrow.*builtin call. ReturnsSome(Result)if the op was recognised,Noneif it should fall through to other dispatch (the caller treatsNoneas “unknown op”). - read_
csv_ at - Read a CSV file into an Arrow
RecordBatch. Header row required; schema is inferred from the first 100 rows. All batches are concatenated into one Table — the v1 API surface returns a single materialised table, not a stream. For 1M-row inputs that’s ~50 MB in memory which is fine for the agentic workloadslex-frametargets; bigger inputs land in a streamingread_csv_iterslice later. - read_
parquet_ at - Read a Parquet file into an Arrow
RecordBatch. Schema comes from the file metadata; all row groups are concatenated into one Table. - read_
parquet_ cols_ at arrow.read_parquet_cols(path, cols)— projection-pushdown variant. Only the requested columns are decoded from the file; missing column names surface asErr, not silently dropped.- write_
csv_ at - Write an Arrow
RecordBatchto a CSV file (header row + rows). Bool → “true”/“false”; null → empty cell (arrow-csv default). - write_
parquet_ at - Write an Arrow
RecordBatchto a Parquet file. Default writer properties (Snappy compression, default page/row-group sizes).