Batch
struct BatchOne Arrow record batch owned by the Rust side.
Columns are copied out on demand and cast on the way: int_col reads any
integer, date, time, timestamp or boolean column as Int64 (timestamps in
microseconds since the epoch, dates in days), float_col reads any numeric
column as Float64, str_col reads any column as UTF-8.
Implements Movable
- Fields
lib: OwnedDLHandleptr: Int
__init__
def __init__(out self, var lib: OwnedDLHandle, ptr: Int) __deinit__
def __deinit__(deinit self) num_rows
def num_rows(self) -> Int num_columns
def num_columns(self) -> Int schema_json
def schema_json(self) -> String JSON array of {"name", "type", "nullable"} for the batch's columns.
int_col
def int_col(self, name: String) -> List[Int64] Column name as Int64. Nulls read back as 0 — use validity to tell them apart.
float_col
def float_col(self, name: String) -> List[Float64] Column name as Float64. Nulls read back as 0.0.
bool_col
def bool_col(self, name: String) -> List[Bool] Column name as Bool. Nulls read back as False.
str_col
def str_col(self, name: String) -> List[String] Column name as UTF-8 strings. Nulls read back as empty strings.
validity
def validity(self, name: String) -> List[Bool] One flag per row of column name: True when the value is present.
export_c_data
def export_c_data(self) -> ArrowCData Export this batch through the Arrow C Data Interface as a struct array (one child per column) — the shape marrow's c_data.mojo imports.