Skip to main content

GraphCreateNode

Struct GraphCreateNode 

Source
pub struct GraphCreateNode {
    pub input: Arc<LogicalPlan>,
    pub nodes: Vec<ResolvedNodeSpec>,
    pub edges: Vec<ResolvedEdgeSpec>,
    pub dir: PathBuf,
    pub mode: OntologyMode,
    /* private fields */
}
Expand description

Logical node for CREATE: a write specification driven by an input plan.

Carries the resolved node/edge specs plus the project directory and ontology mode needed to drive a writer. The directory is baked in at lowering time because the physical-planning layer (an ExtensionPlanner) only sees the DataFusion session state, not the GraphForge project path.

§Input

The CREATE runs once per input row (#703): a standalone CREATE (:X) lowers over the implicit single unit row (so it creates exactly once), while a mixed MATCH … CREATE … runs the write once per matched row, referencing MATCH-bound vars’ identities (ResolvedNodeSpec::is_reference) and minting the rest. The input columns are consumed (for cardinality + referenced identities), not projected — the node still emits only the write summary.

Output schema is a one-row write summary: nodes_created / edges_created (UInt64).

Fields§

§input: Arc<LogicalPlan>

Input plan whose rows drive the writes (the implicit unit row for a standalone CREATE; the MATCH results for a mixed pipeline).

§nodes: Vec<ResolvedNodeSpec>

Nodes to create, in pattern order.

§edges: Vec<ResolvedEdgeSpec>

Edges to create, in pattern order.

§dir: PathBuf

Target project directory.

§mode: OntologyMode

Ontology mode (drives writer edge / property routing).

Implementations§

Source§

impl GraphCreateNode

Source

pub fn summary_schema() -> Arc<Schema> ⓘ

Build the write-summary Arrow schema (nodes_created, edges_created, properties_set, labels_added).

Source

pub fn new( input: Arc<LogicalPlan>, nodes: Vec<ResolvedNodeSpec>, edges: Vec<ResolvedEdgeSpec>, dir: PathBuf, mode: OntologyMode, ) -> Self

Create a new graph-create node over input in summary mode: the node emits the one-row write summary (a terminal CREATE).

Source

pub fn new_emitting( input: Arc<LogicalPlan>, nodes: Vec<ResolvedNodeSpec>, edges: Vec<ResolvedEdgeSpec>, dir: PathBuf, mode: OntologyMode, output_schema: DFSchemaRef, ) -> Self

Create a node in emit-rows mode (write-result RETURN, #814): instead of the summary, it emits one row per input row carrying the input columns plus the created variables’ var_<n>-qualified identity + property columns (output_schema), so a following RETURN/WITH can read them. Side effects are reported out of band (the exec’s tally), since a relation cannot also carry the summary.

Source

pub fn emits_rows(&self) -> bool

Whether this node emits created-entity rows (true) rather than the one-row write summary (false).

Trait Implementations§

Source§

impl Clone for GraphCreateNode

Source§

fn clone(&self) -> Self

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 GraphCreateNode

Source§

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

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

impl Eq for GraphCreateNode

Source§

impl Hash for GraphCreateNode

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for GraphCreateNode

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for GraphCreateNode

Source§

fn partial_cmp(&self, _other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl UserDefinedLogicalNodeCore for GraphCreateNode

Source§

fn name(&self) -> &str

Return the plan’s name.
Source§

fn inputs(&self) -> Vec<&LogicalPlan>

Return the logical plan’s inputs.
Source§

fn schema(&self) -> &DFSchemaRef

Return the output schema of this logical plan node.
Source§

fn expressions(&self) -> Vec<Expr>

Returns all expressions in the current logical plan node. This should not include expressions of any inputs (aka non-recursively). These expressions are used for optimizer passes and rewrites.
Source§

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

Write a single line, human readable string to f for use in explain plan. Read more
Source§

fn with_exprs_and_inputs( &self, exprs: Vec<Expr>, inputs: Vec<LogicalPlan>, ) -> DfResult<Self>

Create a new UserDefinedLogicalNode with the specified children and expressions. This function is used during optimization when the plan is being rewritten and a new instance of the UserDefinedLogicalNode must be created. Read more
Source§

fn check_invariants( &self, _check: InvariantLevel, ) -> Result<(), DataFusionError>

Perform check of invariants for the extension node. Read more
Source§

fn prevent_predicate_push_down_columns(&self) -> HashSet<String>

A list of output columns (e.g. the names of columns in self.schema()) for which predicates can not be pushed below this node without changing the output. Read more
Source§

fn necessary_children_exprs( &self, _output_columns: &[usize], ) -> Option<Vec<Vec<usize>>>

Returns the necessary input columns for this node required to compute the columns in the output schema Read more
Source§

fn supports_limit_pushdown(&self) -> bool

Returns true if a limit can be safely pushed down through this UserDefinedLogicalNode node. Read more

Auto Trait Implementations§

Blanket Implementations§

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> DynEq for T
where T: Eq + Any,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<T> DynHash for T
where T: Hash + Any,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> UserDefinedLogicalNode for T

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Return a reference to self as Any, to support dynamic downcasting Read more
Source§

fn name(&self) -> &str

Return the plan’s name.
Source§

fn inputs(&self) -> Vec<&LogicalPlan>

Return the logical plan’s inputs.
Source§

fn schema(&self) -> &Arc<DFSchema> ⓘ

Return the output schema of this logical plan node.
Source§

fn check_invariants(&self, check: InvariantLevel) -> Result<(), DataFusionError>

Perform check of invariants for the extension node.
Source§

fn expressions(&self) -> Vec<Expr>

Returns all expressions in the current logical plan node. This should not include expressions of any inputs (aka non-recursively). Read more
Source§

fn prevent_predicate_push_down_columns(&self) -> HashSet<String>

A list of output columns (e.g. the names of columns in self.schema()) for which predicates can not be pushed below this node without changing the output. Read more
Source§

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

Write a single line, human readable string to f for use in explain plan. Read more
Source§

fn with_exprs_and_inputs( &self, exprs: Vec<Expr>, inputs: Vec<LogicalPlan>, ) -> Result<Arc<dyn UserDefinedLogicalNode>, DataFusionError>

Create a new UserDefinedLogicalNode with the specified children and expressions. This function is used during optimization when the plan is being rewritten and a new instance of the UserDefinedLogicalNode must be created. Read more
Source§

fn necessary_children_exprs( &self, output_columns: &[usize], ) -> Option<Vec<Vec<usize>>>

Returns the necessary input columns for this node required to compute the columns in the output schema Read more
Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Update the hash state with this node requirements from Hash. Read more
Source§

fn dyn_eq(&self, other: &dyn UserDefinedLogicalNode) -> bool

Compare other, respecting requirements from Eq. Read more
Source§

fn dyn_ord(&self, other: &dyn UserDefinedLogicalNode) -> Option<Ordering>

Compare other, respecting requirements from PartialOrd. Must return Some(Equal) if and only if self.dyn_eq(other).
Source§

fn supports_limit_pushdown(&self) -> bool

Returns true if a limit can be safely pushed down through this UserDefinedLogicalNode node. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V