pub struct PhysicalOptionalExtend {
pub rel_table_name: String,
pub rel_table_id: u64,
pub rel_var: String,
pub src_node_var: String,
pub dst_node_var: String,
pub direction: EdgeDirection,
pub table_catalog: Arc<TableCatalog>,
}Expand description
Physical operator for OPTIONAL MATCH over an already-bound pair of node
variables, e.g. OPTIONAL MATCH (a)-[existing:Connected]-(b) where both
a and b come from the mandatory side (P53.25).
For each input row the relationship-table adjacency is probed for an edge
between the source and destination node ids. When an edge exists, its
property columns (plus an internal {rel_var}._id holding the edge index)
are emitted; when no edge exists, those columns are NULL-padded and exactly
one row is still produced (outer-join semantics).
Fan-out mode (P53.40): when dst_node_var is empty the destination is
anonymous — OPTIONAL MATCH (m)-[r:R]-(:T) — so EVERY edge incident on the
source becomes one output row (zero edges still yield one NULL-padded row).
This preserves multi-edge cardinality for downstream aggregates such as
WITH m, COUNT(r) AS cnt; the previous fallback routed such patterns
through a cross-product merge that duplicated every left row.
Output layout: [input_fields | rel_properties | {rel_var}._id].
Fields§
§rel_table_name: StringName of the relationship table to probe.
rel_table_id: u64ID of the relationship table.
rel_var: StringVariable name of the relationship (e.g., “existing”); prefix for the emitted edge property columns.
src_node_var: StringVariable name of the bound source node (e.g., “a”).
dst_node_var: StringVariable name of the bound destination node (e.g., “b”). Empty string selects fan-out mode: all edges incident on the source are emitted.
direction: EdgeDirectionDirection of the probe (forward, backward, or both).
table_catalog: Arc<TableCatalog>Table catalog for data access.
Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PhysicalOptionalExtend
impl !UnwindSafe for PhysicalOptionalExtend
impl Freeze for PhysicalOptionalExtend
impl Send for PhysicalOptionalExtend
impl Sync for PhysicalOptionalExtend
impl Unpin for PhysicalOptionalExtend
impl UnsafeUnpin for PhysicalOptionalExtend
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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