Skip to main content

Module mutator

Module mutator 

Source
Expand description

In-place mutation primitives for DELETE / DETACH DELETE (#740).

Unlike GraphWriter, which buffers and appends, these functions rewrite committed Parquet files: they read the current on-disk rows, drop the targeted ones (by node_uuid / edge_uuid), and write the survivors back. They operate directly on a project directory and take effect immediately — there is no buffering.

Each file is read, filtered against a keep-mask, and its replacement staged into a RewriteBatch; a delete’s rewrites then commit all-or-nothing (#790), with topology/nodes.parquet renamed last so even a (rare) rename-phase failure leaves at worst orphaned-but-unreferenced rows, never a deleted node with surviving edges. A failure while building any replacement file leaves the prior state fully intact. Files not touched by a given delete are never opened.

Functions§

delete_edges
Delete the given edges by edge_uuid, rewriting every topology/edges/*.parquet file and dropping the same edges’ rows from any edge_properties/*.parquet.
delete_nodes
Delete the given nodes by node_uuid, rewriting topology/nodes.parquet and dropping the same nodes’ rows from every properties/*.parquet file.
delete_nodes_and_edges
Delete nodes and edges as one all-or-nothing statement (#790): stages every rewrite — edge files, edge properties, node properties, and topology/nodes.parquet strictly last — then commits once. A failure while building any replacement file leaves the prior on-disk state fully intact; a (rare) rename-phase failure is bounded by the ordering to consistent states — at worst orphaned-but-unreferenced rows, never a deleted node with surviving edges.
incident_edge_uuids
Return the edge_uuids of every edge incident to any of node_uuids (as src or dst), across all edge files.
stage_add_node_labels
Stage label additions for persisted nodes into the statement rewrite batch. Existing labels and the immutable primary type_id are preserved.
stage_delete_edges
Stage the deletion of the given edges into staged: every topology/edges/*.parquet, then any edge_properties/*.parquet. Returns the edge rows that will be removed.
stage_delete_nodes
Stage the deletion of the given nodes into staged: every properties/*.parquet first, then topology/nodes.parquet last — the authoritative existence record commits only after everything that refers to those nodes (#790). Returns the node rows that will be removed.
stage_mutate_node_labels
Stage label additions and removals for persisted nodes in one topology rewrite. The scalar primary type_id remains unchanged as a routing key; type_ids is the authoritative label-membership set.