Sign in

    codeworm96/magpiedb/engine does not have a README file

    Row

    type Row = Array[Value]

    Rows stay as a public convenience type; internal operators should stay columnar.

    ColumnDef

    pub(all) struct ColumnDef {
    name : String
    data_type : LogicalType
    nullable : Bool
    } derive(Eq,
    Debug
    )

    Column metadata is stable across chunks and result sets.
    impl Show for ColumnDef

    DataChunk

    pub(all) struct DataChunk {
    schema : Schema
    columns : Array[Vector]
    len : Int
    } derive(Eq,
    Debug
    )

    DataChunk is the internal execution batch: many aligned column vectors, no rows.
    impl Show for DataChunk

    DataChunk::column_count

    fn DataChunk::column_count(self : DataChunk) -> Int

    DataChunk::empty

    fn DataChunk::empty(schema : Schema) -> DataChunk

    Chunk construction follows schema order so downstream operators can index cheaply.

    DataChunk::is_empty

    fn DataChunk::is_empty(self : DataChunk) -> Bool

    DataChunk::is_full

    fn DataChunk::is_full(self : DataChunk) -> Bool

    LogicalType

    pub(all) enum LogicalType {
    Null
    Boolean
    BigInt
    Double
    Varchar
    } derive(Eq,
    Debug
    )

    Scalar logical types shared by planning, scanning, and execution.
    impl Show for LogicalType

    Schema

    pub(all) struct Schema {
    columns : Array[ColumnDef]
    } derive(Eq,
    Debug
    )

    Schemas describe column order and names; vectors follow this order exactly.

    Schema::column_count

    fn Schema::column_count(self : Schema) -> Int

    Schema::column_index

    fn Schema::column_index(self : Schema, name : String) -> Int?

    Column names are resolved by exact schema order for deterministic plans/results.

    ValidityMask

    pub(all) struct ValidityMask {
    bits : Array[Bool]
    } derive(Eq,
    Debug
    )

    Nullability is tracked separately from typed buffers to avoid sentinel values.

    ValidityMask::all_null

    fn ValidityMask::all_null(len : Int) -> ValidityMask

    ValidityMask::all_valid

    fn ValidityMask::all_valid(len : Int) -> ValidityMask

    ValidityMask::is_valid

    fn ValidityMask::is_valid(self : ValidityMask, index : Int) -> Bool?

    ValidityMask::len

    fn ValidityMask::len(self : ValidityMask) -> Int

    ValidityMask::new

    fn ValidityMask::new(bits : Array[Bool]) -> ValidityMask

    Value

    pub(all) enum Value {
    Null
    Boolean(Bool)
    BigInt(Int64)
    Double(Double)
    Varchar(String)
    } derive(Eq,
    Debug
    )

    Public scalar value container used at API boundaries.
    impl Show for Value

    Value::is_null

    fn Value::is_null(self : Value) -> Bool

    Value::logical_type

    fn Value::logical_type(self : Value) -> LogicalType

    Vector

    pub(all) struct Vector {
    logical_type : LogicalType
    values : VectorBuffer
    validity : ValidityMask
    } derive(Eq,
    Debug
    )

    A vector is one typed column plus its validity mask.

    Vector::is_empty

    fn Vector::is_empty(self : Vector) -> Bool

    Vector::len

    fn Vector::len(self : Vector) -> Int

    VectorBuffer

    pub(all) enum VectorBuffer {
    Nulls(Int)
    Bool(Array[Bool])
    Int64(Array[Int64])
    Double(Array[Double])
    Varchar(Array[String])
    } derive(Eq,
    Debug
    )

    Typed buffers hold only non-null payload storage for one logical column.

    chunk_row_at

    fn chunk_row_at(chunk : DataChunk, row_index : Int) -> Array[Value]

    chunks_to_rows

    fn chunks_to_rows(chunks : Array[DataChunk]) -> Array[Array[Value]]

    empty_vector

    fn empty_vector(logical_type : LogicalType) -> Vector

    Empty vectors still carry a logical type so operators can preserve schemas.

    fixed_vector_size

    let fixed_vector_size : Int

    The executor processes chunks in fixed-size vectors from the start.

    vector_value_at

    fn vector_value_at(vector : Vector, row_index : Int) -> Value

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io