Storage

Column-oriented storage with typed arrays, null bitmaps, and a single-file format.

Column Types

Four concrete types, each backed by a native Go slice:

TypeGo backingFile
Int64[]int64int64.go
Float64[]float64float64.go
String[]stringstring.go
Bool[]boolbool.go

ColumnChunk

The fundamental unit of storage. Each chunk holds:

NullBitmap

Bit-packed representation where each bit tracks one row's null status. Uses uint64 words internally — 64 rows per word. Operations:

bitmap.Set(i)       // mark row i as null
bitmap.IsNull(i)    // check if row i is null
bitmap.NullCount()  // count nulls

RowGroup

A collection of ColumnChunks that share the same row count. The RowGroup is the unit of I/O — the execution engine reads one RowGroup at a time.

RowGroup (N rows) ├── ColumnChunk "name" [string × N] + bitmap ├── ColumnChunk "age" [int64 × N] + bitmap ├── ColumnChunk "city" [string × N] + bitmap └── ColumnChunk "salary" [float64× N] + bitmap

File Format

Single-file columnar format, similar to Parquet:

┌──────────────┐ │ Magic (8B) │ ├──────────────┤ │ RowGroup 0 │ │ RowGroup 1 │ │ ... │ ├──────────────┤ │ Footer │ ← column names, types, offsets ├──────────────┤ │ Magic (8B) │ └──────────────┘

The footer stores metadata (column names, types, byte offsets) so the reader can seek directly to any column without scanning the whole file.

Files

FileRole
types.goColumn type enum and interface
chunk.goColumnChunk struct and methods
rowgroup.goRowGroup — collection of chunks
bitmap.goBit-packed null bitmap
format.goFile header, footer, metadata structs
writer.goSerialize row groups to disk
reader.goDeserialize row groups from disk