Skip to main content

GraphOp

Enum GraphOp 

Source
#[non_exhaustive]
pub enum GraphOp {
Show 28 variants NodeScan { var: VarId, ty: Option<TypeId>, }, EdgeScan { var: VarId, ty: Option<TypeId>, }, TypedEdgeScan { var: VarId, rel_ty: TypeId, }, Expand { src: VarId, edge: VarId, dst: VarId, rel_ty: Option<TypeId>, dir: Direction, min_hops: u16, max_hops: Option<u16>, }, RelationshipUnique { edge: VarId, prior_edges: Vec<VarId>, }, Filter { predicate: ExprId, }, Project { items: Vec<ProjectItem>, distinct: bool, }, Aggregate { group_by: Vec<ExprId>, group_aliases: Vec<Option<String>>, group_vars: Vec<Option<VarId>>, aggs: Vec<AggExpr>, }, Sort { keys: Vec<SortKey>, }, Limit { count: u64, }, LimitParam { name: String, }, LimitExpr { expr: ExprId, }, Skip { count: u64, }, SkipParam { name: String, }, SkipExpr { expr: ExprId, }, Optional { child: Box<GraphPlan>, }, Exists { child: Box<GraphPlan>, negated: bool, }, PatternComprehension { child: Box<GraphPlan>, output: VarId, }, ListElementPatternComprehension { list_expr: ExprId, loop_var: VarId, child: Box<GraphPlan>, pattern_output: VarId, filter: Option<ExprId>, projection: Option<ExprId>, output: VarId, }, Union { all: bool, inputs: Vec<GraphPlan>, }, Unwind { list_expr: ExprId, alias: VarId, }, Call { procedure: ProcedureDefinition, args: Vec<ExprId>, yields: Vec<ProcedureYield>, }, Create { pattern: CreatePattern, }, Merge { pattern: CreatePattern, on_create: Vec<MergeSetItem>, on_match: Vec<MergeSetItem>, }, Delete { vars: Vec<VarId>, exprs: Vec<ExprId>, detach: bool, }, Set { items: Vec<SetPropItem>, map_items: Vec<SetMapItem>, label_items: Vec<LabelItem>, }, Remove { items: Vec<RemovePropItem>, label_items: Vec<LabelItem>, }, With { items: Vec<ProjectItem>, distinct: bool, where_predicate: Option<ExprId>, },
}
Expand description

A single operator node in a GraphPlan.

Plans are represented as a flat Vec<GraphOp> (operators in pipeline order). Recursive structure — e.g. optional matches, unions — is expressed by variants that embed a child GraphPlan.

This enum is #[non_exhaustive] so that adding new operators in a minor version does not constitute a breaking change for downstream crates that match on it.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NodeScan

Scan all nodes, optionally filtered to a single label type.

ty: None scans every node regardless of label.

Fields

§var: VarId

The variable that receives each scanned node.

§ty: Option<TypeId>

The label type to filter on, or None for a full scan.

§

EdgeScan

Wildcard edge scan across all relation types.

Prefer TypedEdgeScan when the relation type is statically known; this variant exists for queries that match any edge.

Fields

§var: VarId

The variable that receives each scanned edge.

§ty: Option<TypeId>

Optional relation type filter.

§

TypedEdgeScan

Scan topology/edges/TYPENAME.parquet for a specific relation type.

This is the primary edge-scan operator emitted by the binder whenever a MATCH pattern specifies a concrete relation type. The relational lowering layer maps rel_ty → relation_name via the ontology (or the RuntimeCatalog in exploratory mode) to determine the Parquet file path. In exploratory mode, if rel_ty is a RuntimeTypeId, the storage layer routes the scan to topology/edges/_exploratory.parquet.

Fields

§var: VarId

The variable that receives each scanned edge.

§rel_ty: TypeId

The concrete relation type to scan.

§

Expand

Expand from a source node along edges to destination nodes.

Fields

§src: VarId

Source node variable.

§edge: VarId

Edge variable.

§dst: VarId

Destination node variable.

§rel_ty: Option<TypeId>

Relation type filter (None = any relation type).

§dir: Direction

Traversal direction.

§min_hops: u16

Minimum number of hops (1 for a single hop).

§max_hops: Option<u16>

Maximum number of hops (None = unbounded).

§

RelationshipUnique

Enforce relationship isomorphism within one path pattern.

Fields

§edge: VarId

Newly bound relationship variable.

§prior_edges: Vec<VarId>

Relationships bound earlier in the same path pattern.

§

Filter

Retain only rows where predicate evaluates to true.

Fields

§predicate: ExprId

The filter predicate expression.

§

Project

Project a set of expressions into named output columns.

Fields

§items: Vec<ProjectItem>

The output columns.

§distinct: bool

If true, duplicate rows are eliminated.

§

Aggregate

Group rows and compute aggregates.

Fields

§group_by: Vec<ExprId>

Expressions to group by.

§group_aliases: Vec<Option<String>>

Output column name for each group-by key (parallel to group_by): Some(name) aliases that key’s result column (openCypher names it by the RETURN item’s source text), None leaves the lowered expr’s default name. Empty or shorter-than-group_by ⇒ no aliasing (#599).

§group_vars: Vec<Option<VarId>>

Synthetic output variable for each group-by key (parallel to group_by), bound to that key’s result column so a following Project can reference it when a RETURN item nests an aggregate (n.x + count(*)). Empty unless the aggregate was decomposed (#599).

§aggs: Vec<AggExpr>

Aggregate expressions.

§

Sort

Sort the row stream by one or more keys.

Fields

§keys: Vec<SortKey>

Ordered list of sort keys.

§

Limit

Retain at most count rows.

Fields

§count: u64

Maximum number of rows to return.

§

LimitParam

Retain at most the row count supplied by a query parameter.

Fields

§name: String

Parameter name without the leading $.

§

LimitExpr

Retain at most the row count produced by a variable-independent expression.

Fields

§expr: ExprId

Expression evaluated once at query execution time.

§

Skip

Skip the first count rows.

Fields

§count: u64

Number of rows to skip.

§

SkipParam

Skip the row count supplied by a query parameter.

Fields

§name: String

Parameter name without the leading $.

§

SkipExpr

Skip the row count produced by a variable-independent expression.

Fields

§expr: ExprId

Expression evaluated once at query execution time.

§

Optional

Execute a child plan and emit its results, substituting NULL for unmatched rows (LEFT OPTIONAL semantics).

Fields

§child: Box<GraphPlan>

The optional sub-plan.

§

Exists

Retain or reject rows according to whether a correlated child plan has at least one match (pattern-predicate semantics).

Fields

§child: Box<GraphPlan>

The correlated sub-plan.

§negated: bool

true for NOT existential predicates.

§

PatternComprehension

Evaluate a correlated pattern and collect one projected value per match.

Fields

§child: Box<GraphPlan>

The correlated match, optional filter, and terminal value projection.

§output: VarId

Synthetic variable receiving the collected list in the outer plan.

§

ListElementPatternComprehension

Evaluate a pattern comprehension once per graph-valued list element.

Fields

§list_expr: ExprId

Source list whose elements bind loop_var in lexical order.

§loop_var: VarId

Lexical list-comprehension element variable.

§child: Box<GraphPlan>

Correlated pattern-comprehension child plan.

§pattern_output: VarId

Synthetic variable receiving the child collection per element.

§filter: Option<ExprId>

Optional list-comprehension filter.

§projection: Option<ExprId>

Optional list-comprehension projection.

§output: VarId

Synthetic variable receiving the reassembled outer list.

§

Union

Combine results from multiple sub-plans.

Fields

§all: bool

If false, duplicates are eliminated (UNION). If true, all rows are kept (UNION ALL).

§inputs: Vec<GraphPlan>

The sub-plans whose results are combined.

§

Unwind

Iterate over a list expression, binding each element to alias.

Fields

§list_expr: ExprId

The expression producing the list to iterate.

§alias: VarId

The variable bound to each list element.

§

Call

Invoke a registered procedure for every input row.

Fields

§procedure: ProcedureDefinition

Frozen signature and deterministic fixture rows.

§args: Vec<ExprId>

Explicit expressions or implicit parameters, in signature order.

§yields: Vec<ProcedureYield>

Procedure outputs introduced into query scope.

§

Create

Create nodes and/or edges described by pattern.

Write-path execution semantics are deferred to Milestone 13; this variant serialises and deserialises but is not covered by execution tests yet.

Fields

§pattern: CreatePattern

The pattern to create.

§

Merge

Match-or-create semantics for pattern.

Same execution-deferral note as Create.

Fields

§pattern: CreatePattern

The pattern to match or create.

§on_create: Vec<MergeSetItem>

Actions applied only when the pattern is created.

§on_match: Vec<MergeSetItem>

Actions applied only when the pattern already exists.

§

Delete

Delete graph entities referenced directly or produced by expressions.

Direct variables use identity columns; runtime expressions may produce nodes, relationships, paths, or null through list/map access. When detach is false, deleting a node that still has relationships is an execution error; detach = true also removes incident edges.

Fields

§vars: Vec<VarId>

The bound variables to delete (nodes and/or edges).

§exprs: Vec<ExprId>

Runtime expressions yielding nodes, relationships, or paths.

§detach: bool

true for DETACH DELETE — remove incident edges with the node.

§

Set

Set properties on bound graph entities (#791).

Each item assigns one property of a bound node or edge variable to a value expression evaluated per matched row. Whether a target is a node or an edge is resolved at lowering from the input row’s identity columns (node_uuid vs edge_uuid). Label and bulk-map writes execute through the statement driver.

Fields

§items: Vec<SetPropItem>

The property assignments, in clause order.

§map_items: Vec<SetMapItem>

Bulk map merge/replacement assignments, in clause order.

§label_items: Vec<LabelItem>

Node-label additions, in clause order.

§

Remove

Remove properties from bound graph entities (#791).

The dual of Set. Removing an absent property or label is a no-op (openCypher).

Fields

§items: Vec<RemovePropItem>

The properties to remove, in clause order.

§label_items: Vec<LabelItem>

Node-label removals, in clause order.

§

With

Project a set of columns and optionally apply a WHERE predicate, then pass results to subsequent operators (WITH clause semantics).

Fields

§items: Vec<ProjectItem>

The output columns.

§distinct: bool

If true, duplicate projected rows are eliminated.

§where_predicate: Option<ExprId>

Optional WHERE predicate applied after projection.

Trait Implementations§

Source§

impl Clone for GraphOp

Source§

fn clone(&self) -> GraphOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GraphOp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for GraphOp

Source§

fn eq(&self, other: &GraphOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for GraphOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GraphOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.