pub enum LogicalOperator {
Show 21 variants
SingleRow,
QueryUnion {
left: Box<LogicalOperator>,
right: Box<LogicalOperator>,
all: bool,
},
ScanByLabel {
variable: String,
label: String,
properties: HashMap<String, PropertyValue>,
},
Unwind {
input: Option<Box<LogicalOperator>>,
expression: ValueExpression,
alias: String,
label: Option<String>,
},
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,
target_label: 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,
},
Union {
inputs: Vec<LogicalOperator>,
},
PathMatch {
input: Box<LogicalOperator>,
path: PathPattern,
},
ShortestPath {
input: Box<LogicalOperator>,
source_variable: String,
target_variable: String,
relationship_type: String,
direction: RelationshipDirection,
min_hops: u32,
max_hops: u32,
all: bool,
path_variable: String,
},
OptionalMatch {
input: Box<LogicalOperator>,
optional: Box<LogicalOperator>,
keys: Vec<String>,
},
ListComprehension {
input: Box<LogicalOperator>,
list: ValueExpression,
variable: String,
label: Option<String>,
element: Box<LogicalOperator>,
keep: Option<BooleanExpression>,
map: ValueExpression,
output: String,
count_only: bool,
},
Apply {
input: Box<LogicalOperator>,
inner: Box<LogicalOperator>,
imports: Vec<String>,
labels: HashMap<String, String>,
id: usize,
},
CallInput {
labels: HashMap<String, String>,
},
ComprehensionElement,
}Expand description
A logical plan operator - describes what operation to perform
Variants§
SingleRow
One row with no bound variables, for queries without reading clauses.
QueryUnion
Language-level UNION; unlike pattern alternation, branches must share output schema.
ScanByLabel
Scan all nodes with a specific label
Unwind
Unwind a list into a sequence of rows
Fields
input: Option<Box<LogicalOperator>>The input operator
expression: ValueExpressionThe expression to unwind (must yield a list)
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) Uses iterative CSR traversal when indexed, otherwise fixed-length branches and a union.
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
Union
UNION ALL of the branches of one MATCH clause that uses relationship-type
alternation or multi-label nodes (see pattern_alternatives). Branches bind the
same variables, possibly with different labels; columns a branch lacks are null.
Fields
inputs: Vec<LogicalOperator>PathMatch
A named path retaining actual relationship occurrences and typed node records.
ShortestPath
shortestPath / allShortestPaths between two variables bound in input; adds
<path_variable>__length and <path_variable>__nodes (node ids, source first).
OptionalMatch
OPTIONAL MATCH: LEFT JOIN of input with optional (which is planned on top of
input‘s distinct shared variables) on the shared variables’ id columns keys.
ListComprehension
[variable IN list WHERE keep | map] for each row of input, into the column
output. The list is unnested with element positions (an empty or null list keeps
its row), element is planned over those element rows (its leaf is
LogicalOperator::ComprehensionElement; EXISTS marks of keep join onto it), and
the kept values are collected back per row in position order. With label, the
list holds node ids and each element is joined to its node.
Fields
input: Box<LogicalOperator>list: ValueExpressionelement: Box<LogicalOperator>keep: Option<BooleanExpression>map: ValueExpressionApply
Evaluate a read-only subquery once per input row, extending it by each result.
CallInput
The single imported row of a CALL body; its values are bound at execution.
ComprehensionElement
The element rows of the enclosing LogicalOperator::ListComprehension.
Trait Implementations§
Source§impl Clone for LogicalOperator
impl Clone for LogicalOperator
Source§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 UnsafeUnpin for LogicalOperator
impl UnwindSafe for LogicalOperator
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Requestimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<E> ResultError for E
impl<T> ResultType for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.