Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/kleene

crates/kleene-iceberg/README.md

kleene-iceberg

Iceberg tables read as they are, as a kleene set. kleene is an in-memory sink of Knut's bifröst (knut-bifrost, built source-only): bifröst's mapping (MappingSpec, RON or YAML) says which table is which node label and which is which edge label, its Iceberg source reads the tables' data files, its transforms hand the rows over, and this crate fills kleene-plan's Catalog from them, so Datalog and GQL run on the tables unchanged. No ETL: nothing is written anywhere, nothing is re-partitioned or copied into another format first.

A mapping (the same file bifröst reads):

(version: 1, tables: [
  (table: "g.person", pipeline: [
    (vertex: (label: "person", id_column: "id", properties: ["age", "name"])),
  ]),
  (table: "g.knows", pipeline: [
    (edge: (type: "knows", src: (label: "person", column: "a"), dst: (label: "person", column: "b"),
            properties: ["since"])),
  ]),
])

On the command line (the umbrella crate's feature iceberg):

kleene gql "MATCH (a:person)-[:knows]->+(b) WHERE id(a) = 0 RETURN DISTINCT id(b)" \
    --iceberg graph.ron <warehouse> [--snapshot g.knows=<snapshot id>]
Part Here
Node label the ids of the label's rows: an integer column, each id at least 0; one id space for every label
Edge label the (from, to) pairs of the label's rows, as a graph over that id space
Property a column, typed as kleene-gar types a set's columns (unsigned, signed, float, boolean, string; others refused by name)
Version each table at its current snapshot, or at a snapshot id given; only metadata is read to find them
Kept what a table gave at a snapshot is kept per (table, snapshot id): asked again, no data file is read; keep_in(dir) keeps it on disk too (kleene-index's Store, keyed by the snapshot id)
Next version advance(&earlier): only what each window changed is read (the data files added; the rows equality deletes, position deletes, deletion vectors and rewrites removed, in commit order); each graph is the old one with new edges added and lost pairs taken out; the added rows and the lost facts come as catalogs of their own for Engine::continue_with
Removals in the history a snapshot read as its history with the removals applied in order (or as its live rows, when skade cannot read a window as rows)

Not read yet: string ids, bifröst's custom steps. A removal on columns the mapping does not read (an equality delete on another key) reads its table whole again (Delta::reread).

Dependencies: knut-bifrost (Knut's branch arrow60, by rev) with default-features = false, features = ["skade"] (an embedded skade warehouse; this crate's features s3 and rest turn on its skade-s3 and skade-rest). One crate in that tree compiles C: ring (through parquet's encryption feature, which iceberg-rust turns on). The umbrella crate does not pull this crate in by default, so kleene's default build stays free of C.