Skip to main content

Module semantic_graph

Module semantic_graph 

Source
Expand description

The computed entity-graph tables greptime_private.semantic_entities and greptime_private.semantic_relationships.

They live in greptime_private, not information_schema: scanning them triggers read-time derivation over telemetry tables (trace self-joins, …), which breaks the “cheap, metadata-only” expectation users have of information_schema. greptime_private also hosts the physical declared-edge table (semantic_relationships_declared), whose rows are unioned into the computed semantic_relationships.

These are thin forwarders: their rows are derived at read time by the injected EntityGraphProvider, which enumerates the table_semantics declarations, builds typed DataFusion derivation plans, and executes them via the query engine. When no provider is injected (e.g. before the engine is up, or on a non-frontend node) they stream empty. The fixed schemas here must match the columns the provider’s plans project; JSON columns are json (JSONB), whose Arrow storage type is Binary — the derived batches are rebuilt against the declared Arrow schema (which carries the json extension metadata) in SystemTable::to_stream.

Structs§

SemanticGraphTable 🔒
Forwarder for a computed entity-graph table.
SemanticGraphTableProvider 🔒
Serves the computed graph tables under greptime_private, overlaid on the schema’s physical tables the same way the numbers table overlays public (the system catalog is consulted before physical table resolution).
TableEntityDeclaration
One entity a table declares, as information_schema.table_semantics reports it. A catalog-side projection of the derivation’s own declaration type, which lives above this crate.

Enums§

DeclarationOrigin
Where a table’s entity declaration came from.
GraphTableKind 🔒
Which computed table this shell represents, so the two share one forwarder.

Statics§

ENTITIES_SCHEMA 🔒
Schema of semantic_entities — the node set of the graph, one row per entity observed in a time window. Must match the registry derivation projection.
RELATIONSHIPS_SCHEMA 🔒
Schema of semantic_relationships — the edge set of the graph, one row per edge observed in a time window. This is the 18-column contract every derived branch and the declared-edge table must project for the top-level UNION ALL.

Traits§

EntityGraphProvider
Produces the rows of the computed entity-graph tables at read time.

Functions§

json 🔒
string 🔒
ts 🔒

Type Aliases§

EntityGraphProviderRef