package granary

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Granary_columnar.Col_storeSource

In-memory columnar store for COLUMNSTORE tables.

Rows are stored as per-column Bigarray arrays for cache-friendly scan performance. Text columns use dictionary encoding.

Sourcetype t
Sourceval create : Row.column list -> t

create columns returns an empty store with the given schema.

Sourceval nrows : t -> int

nrows store returns the number of rows currently held.

Sourceval columns : t -> Row.column list

columns store returns the schema that was passed to create.

Sourceval insert_rows : t -> Row.t array -> unit

insert_rows store batch appends batch to the store, transposing rows into typed column arrays.

Sourceval to_row_seq : t -> Row.t Seq.t

to_row_seq store streams all rows in insertion order by reading from the typed column arrays.

Sourceval encode : t -> bytes

encode store serializes the entire store (schema + data) to a byte string.

Sourceval decode : ?off:int -> Row.column list -> bytes -> t

decode ?off schema buf deserializes a store from buf starting at offset off (default 0) using the given schema. Raises Failure on corrupt or malformed data.

Sourceval dirty : t -> bool

dirty store returns true if the store has been mutated since the last call to mark_clean (i.e. has unpersisted changes).

Sourceval mark_clean : t -> unit

mark_clean store resets the dirty flag.

Sourceval mark_dirty : t -> unit

mark_dirty store sets the dirty flag.