ColumnBuilder
struct ColumnBuilderOne column's values, before they become an Arrow array.
add takes a Datum per cell. add_bytes, add_int, add_float and
add_bool take the value itself and append it straight to the Arrow
buffers, with no tagged value at all — what a parser that already holds
the bytes or the integer should use. The two may be mixed: Datums wait
in values and are folded into array, in order, before the next direct
append and when the column is built.
Implements Copyable, Movable, Sized
- Fields
name: Stringfield_id: Intkind: UInt8precision: Intscale: Intlength: Intnullable: Boolvalues: List[Datum]:Datums added since the last direct append, not yet inarray.array: ArrayData: Everything beforevalues. Its last validity byte may be short until the column is built.
__init__
def __init__(out self, var name: String, field_id: Int, kind: UInt8, precision: Int = Int(0), scale: Int = Int(0), length: Int = Int(0), nullable: Bool = True) of
def of(schema: Schema, field_id: Int) -> Self A builder typed by one of the table's columns.
add
def add(mut self, var value: Datum) add_null
def add_null(mut self) add_bytes
def add_bytes(mut self, value: Span[UInt8]) A string or binary value, as its bytes (UTF-8 for a string).
add_int
def add_int(mut self, value: Int64) An int, long, date, time or timestamp value, in the units the column stores (days, microseconds, nanoseconds).
add_float
def add_float(mut self, value: Float64) A float or double value.
add_bool
def add_bool(mut self, value: Bool) A boolean value.
__len__
def __len__(self) -> Int build_tree
def build_tree(self) -> ColumnTree The same array, ready to sit beside a nested one.
build
def build(self) -> ArrayData The column as an Arrow array, leaving the builder as it was.
take
def take(deinit self) -> ArrayData The column as an Arrow array, without build's copy of it.