pub enum LogicalOperator {
ScanByLabel {
variable: String,
label: String,
properties: HashMap<String, PropertyValue>,
},
Filter {
input: Box<LogicalOperator>,
predicate: BooleanExpression,
},
Expand {
input: Box<LogicalOperator>,
source_variable: String,
target_variable: String,
target_label: String,
relationship_types: Vec<String>,
direction: RelationshipDirection,
relationship_variable: Option<String>,
properties: HashMap<String, PropertyValue>,
target_properties: HashMap<String, PropertyValue>,
},
VariableLengthExpand {
input: Box<LogicalOperator>,
source_variable: String,
target_variable: String,
relationship_types: Vec<String>,
direction: RelationshipDirection,
relationship_variable: Option<String>,
min_length: Option<u32>,
max_length: Option<u32>,
target_properties: HashMap<String, PropertyValue>,
},
Project {
input: Box<LogicalOperator>,
projections: Vec<ProjectionItem>,
},
Join {
left: Box<LogicalOperator>,
right: Box<LogicalOperator>,
join_type: JoinType,
},
Distinct {
input: Box<LogicalOperator>,
},
Sort {
input: Box<LogicalOperator>,
sort_items: Vec<SortItem>,
},
Offset {
input: Box<LogicalOperator>,
offset: u64,
},
Limit {
input: Box<LogicalOperator>,
count: u64,
},
}Expand description
A logical plan operator - describes what operation to perform
Variants§
ScanByLabel
Scan all nodes with a specific label
Filter
Apply a filter predicate (WHERE clause)
Expand
Traverse relationships (the core graph operation)
Represents a single-hop relationship traversal: (source)-[rel]->(target)
Fields
input: Box<LogicalOperator>The input operator (typically a node scan or previous expand)
target_label: StringLabel of the target node (e.g., “Person”, “Book”) This is essential for looking up the correct schema during planning
direction: RelationshipDirectionDirection of traversal (Outgoing, Incoming, or Undirected)
relationship_variable: Option<String>Optional variable name for the relationship itself (e.g., “r” in -[r]->)
properties: HashMap<String, PropertyValue>Property filters to apply on the relationship
target_properties: HashMap<String, PropertyValue>Property filters to apply on the target node
VariableLengthExpand
Variable-length path expansion (*1..2 syntax)
Represents multi-hop relationship traversals: (source)-[rel*min..max]->(target) This is implemented by unrolling into multiple fixed-length paths and unioning them
Fields
input: Box<LogicalOperator>The input operator (typically a node scan)
direction: RelationshipDirectionDirection of traversal for each hop
target_properties: HashMap<String, PropertyValue>Property filters to apply on target nodes
Project
Project specific columns (RETURN clause)
Join
Join multiple disconnected patterns
Distinct
Apply DISTINCT
Fields
input: Box<LogicalOperator>Sort
Apply ORDER BY
Offset
Apply SKIP/OFFSET
Limit
Apply LIMIT
Trait Implementations§
Source§impl Clone for LogicalOperator
impl Clone for LogicalOperator
Source§fn clone(&self) -> LogicalOperator
fn clone(&self) -> LogicalOperator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalOperator
impl Debug for LogicalOperator
Source§impl<'de> Deserialize<'de> for LogicalOperator
impl<'de> Deserialize<'de> for LogicalOperator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LogicalOperator
impl PartialEq for LogicalOperator
Source§impl Serialize for LogicalOperator
impl Serialize for LogicalOperator
impl StructuralPartialEq for LogicalOperator
Auto Trait Implementations§
impl Freeze for LogicalOperator
impl RefUnwindSafe for LogicalOperator
impl Send for LogicalOperator
impl Sync for LogicalOperator
impl Unpin for LogicalOperator
impl UnwindSafe for LogicalOperator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more