Expand description
GraphWriter — buffered Parquet write path for the UUID-first topology /
properties layout (#579).
Callers mint UUIDv7 identifiers (via graphforge_core::uuid::new_v7) and feed
nodes, edges, and properties to the writer; it assigns integer surrogate IDs
(node_id / edge_id), buffers rows in memory, and materialises them to
Parquet on flush. The output round-trips through
GraphCatalog.
Routing depends on OntologyMode:
| edges | node properties | |
|---|---|---|
| Strict / Advisory | topology/edges/TYPENAME.parquet (TYPED_EDGE_SCHEMA) | properties/TYPENAME.parquet |
| Exploratory | topology/edges/_exploratory.parquet (EXPLORATORY_EDGE_SCHEMA) | properties/_untyped.parquet |
Edge properties (#784) are written separately under
edge_properties/REL_TYPE.parquet, keyed by edge_uuid and routed by
relation name in every mode (a dedicated directory so a relation type
cannot collide with a node label of the same name in properties/).
§Behaviour and limitations (baseline write path)
flushmerges the buffered rows with whatever is already on disk (read-modify-write), so separate write sessions accumulate (#733). Each file write is atomic (temp + rename, #790) — an I/O failure mid-write leaves the prior file intact — but the merge is per file: a failure between files commits some files and not others (nodes first, so the partial state is consistent; durability/fsync stays out of scope for this non-production, small-graph engine). There is no cross-session dedup: pureCREATEmints fresh UUIDs, so anode_uuidnever recurs; MATCH…CREATE upsert is deferred to #703.- Surrogate
node_id/edge_idvalues start at 1 (0 is reserved as a sentinel) and continue from the on-disk maximum when a writer is opened on an existing project, so appended rows get fresh, monotonic surrogates. _untypedproperty schemas are inferred from the buffered literals (union of property names, type from the first non-null value seen). A column that sees conflicting scalar types uses a tagged scalar struct so values retain their openCypher types.- In Advisory / Strict mode the writer trusts the caller’s
rel_typeas the typed edge file name — it performs no ontology validation here (that lives in the execution layer, which holds the ontology handle). _untypedproperty files are not auto-registered by [GraphCatalog] yet; onlynode_uuidis in its read schema until the runtime catalog learns the columns.- The writer only ever creates
topology/andproperties/(the always-on baseline capabilities); capability-gated directories for other features are deferred to when those capabilities exist.
Structs§
- Graph
Writer - Buffered Parquet writer for graph topology and properties.
Functions§
- count_
entity_ properties - Count non-null properties owned by the selected persisted entities across every dynamic-schema property partition.
- read_
entity_ properties - Read the complete non-null property map for one persisted entity.
- read_
entity_ property_ keys - Read the non-null property keys currently stored for one entity.
- read_
node_ property_ rows - Read every UUID-keyed node property row from one persisted stem.
- remove_
edge_ properties - Rewrite
edge_properties/<rel_stem>.parquetapplying per-edge_uuidREMOVEremovals, staged and committed as one batch (#790). - remove_
node_ properties - Rewrite
properties/<stem>.parquetapplying per-node_uuidREMOVEremovals, staged and committed as one batch (#790). - set_
edge_ properties_ rewrite - Rewrite
edge_properties/<rel_stem>.parquetapplying per-edge_uuidSETupdates, staged and committed as one batch (#790). - set_
node_ properties - Rewrite
properties/<stem>.parquetapplying per-node_uuidSETupdates, staged and committed as one batch (#790). - stage_
remove_ edge_ properties - Stage a rewrite of
edge_properties/<rel_stem>.parquetapplying per-edge_uuidREMOVEremovals. Edge analogue ofstage_remove_node_properties. - stage_
remove_ node_ properties - Stage a rewrite of
properties/<stem>.parquetapplying per-node_uuidREMOVEremovals. Returns the number of distinct nodes targeted. - stage_
set_ edge_ properties - Stage a rewrite of
edge_properties/<rel_stem>.parquetapplying per-edge_uuidSETupdates. Edge analogue ofstage_set_node_properties; the join key isedge_uuidand the file is routed by relation name. - stage_
set_ node_ properties - Stage a rewrite of
properties/<stem>.parquetapplying per-node_uuidSETupdatesintostaged(committed by the caller, #790).
Type Aliases§
- Pending
Node Match - Identity, labels, and properties of a buffered node matched by MERGE.