package granary

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

Module Granary_columnar.ColSource

Typed column arrays backed by Bigarray.

Each column is stored as a contiguous typed array — Int64 and Real columns use Bigarray for cache-friendly sequential scan; Text columns use dictionary encoding; Blob columns use OCaml bytes arrays.

Sourcetype t
Sourceval pp : Format.formatter -> t -> unit

pp fmt col pretty-prints the column variant and row count.

Sourceval create : Row.ty -> int -> t

create ty cap creates an empty column with the given type and initial capacity.

Sourceval length : t -> int

length col returns the number of rows in the column.

Sourceval dict_size : t -> int

dict_size col returns the number of entries in the dictionary for a Text column, or 0 for non-text column types.

Sourceval append_value : t -> Row.value -> t

append_value col v returns a new column with v appended.

Sourceval get_value : t -> int -> Row.value

get_value col idx returns the value at position idx.

Sourceval append_batch : t -> Row.value array -> t

append_batch col rows returns a new column with all rows appended.

Sourceval of_values : Row.column list -> Row.t array -> t array

of_values schema rows transposes a row-major array into column-major typed arrays, one per schema column.

Sourceval encode : t -> bytes

encode col serializes the column to a portable byte string.

Sourceval decode : bytes -> int -> t * int

decode buf off deserializes a column from buf starting at offset off, returning the column and the next offset. Raises Failure on corrupt or unknown data.