pub struct GraphTraversalNode {
pub graph: String,
pub traversal: Traversal,
pub input: Arc<LogicalPlan>,
pub weighted: Option<Arc<LogicalPlan>>,
pub vertices: Option<Arc<LogicalPlan>>,
pub weight: Option<String>,
pub nodes: Vec<Arc<LogicalPlan>>,
pub written: Vec<String>,
pub source: Expr,
pub destination: Expr,
pub id_type: DataType,
/* private fields */
}Expand description
Run a traversal (hop, shortest_path, random_walk) over the edges its
first input produces.
Its inputs, in order:
- the edge rows projected to the endpoints, exactly as a
GraphAlgorithmNode’s first input, so the two share one index; - for a weighted
shortest_path, the weighted edge plan, as aGraphAlgorithmNode’s second input (with one weight column); - for a graph with a vertex table, its keys, as a
GraphAlgorithmNode’s; - one plan per node-id parameter (
seeds;sourceandtarget;start), each of one column: aVALUESlist for a literal, or the planned subquery. They run when the node runs, never while the query is planned, and their values are cast to the graph’s id type then.
The output is the traversal’s own rows (see super::traversal).
Fields§
§graph: StringThe graph’s name, for plans and messages.
traversal: Traversal§input: Arc<LogicalPlan>The edge rows, projected to the endpoints.
weighted: Option<Arc<LogicalPlan>>The edge rows projected to the endpoints and the weight, for a weighted shortest path.
vertices: Option<Arc<LogicalPlan>>The graph’s vertex keys (see GraphAlgorithmNode::vertices).
weight: Option<String>The weight expression, as written, for EXPLAIN.
nodes: Vec<Arc<LogicalPlan>>One plan per node-id parameter, in the spec’s order.
written: Vec<String>Each node-id argument as written, for EXPLAIN.
source: ExprThe source and destination of each edge: column references into
input.
destination: Expr§id_type: DataTypeThe node id type (see GraphAlgorithmNode::id_type).
Implementations§
Source§impl GraphTraversalNode
impl GraphTraversalNode
pub fn try_new( graph: String, traversal: Traversal, input: Arc<LogicalPlan>, weighted: Option<Arc<LogicalPlan>>, vertices: Option<Arc<LogicalPlan>>, weight: Option<String>, nodes: Vec<Arc<LogicalPlan>>, written: Vec<String>, source: Expr, destination: Expr, ) -> Result<Self>
Sourcepub fn endpoint_indices(&self) -> Result<(usize, usize)>
pub fn endpoint_indices(&self) -> Result<(usize, usize)>
The positions of the source and destination columns in the input.
Trait Implementations§
Source§impl Clone for GraphTraversalNode
impl Clone for GraphTraversalNode
Source§impl Debug for GraphTraversalNode
impl Debug for GraphTraversalNode
impl Eq for GraphTraversalNode
Source§impl Hash for GraphTraversalNode
impl Hash for GraphTraversalNode
Source§impl PartialEq for GraphTraversalNode
impl PartialEq for GraphTraversalNode
Source§impl PartialOrd for GraphTraversalNode
impl PartialOrd for GraphTraversalNode
Source§impl UserDefinedLogicalNodeCore for GraphTraversalNode
impl UserDefinedLogicalNodeCore for GraphTraversalNode
Source§fn expressions(&self) -> Vec<Expr>
fn expressions(&self) -> Vec<Expr>
The endpoint columns, so DataFusion keeps them in the input.
Source§fn necessary_children_exprs(
&self,
_output_columns: &[usize],
) -> Option<Vec<Vec<usize>>>
fn necessary_children_exprs( &self, _output_columns: &[usize], ) -> Option<Vec<Vec<usize>>>
Both endpoints of the first input, every column of the weighted input, the vertex key, and the one column of each node-id input.
Source§fn prevent_predicate_push_down_columns(&self) -> HashSet<String>
fn prevent_predicate_push_down_columns(&self) -> HashSet<String>
Filters on the output are about the traversal’s rows, not the edges or the node ids: none moves below.
Source§fn inputs(&self) -> Vec<&LogicalPlan>
fn inputs(&self) -> Vec<&LogicalPlan>
Source§fn schema(&self) -> &DFSchemaRef
fn schema(&self) -> &DFSchemaRef
Source§fn fmt_for_explain(&self, f: &mut Formatter<'_>) -> Result
fn fmt_for_explain(&self, f: &mut Formatter<'_>) -> Result
f for use in explain plan. Read moreSource§fn with_exprs_and_inputs(
&self,
exprs: Vec<Expr>,
inputs: Vec<LogicalPlan>,
) -> Result<Self>
fn with_exprs_and_inputs( &self, exprs: Vec<Expr>, inputs: Vec<LogicalPlan>, ) -> Result<Self>
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 moreSource§fn check_invariants(
&self,
_check: InvariantLevel,
) -> Result<(), DataFusionError>
fn check_invariants( &self, _check: InvariantLevel, ) -> Result<(), DataFusionError>
Source§fn supports_limit_pushdown(&self) -> bool
fn supports_limit_pushdown(&self) -> bool
true if a limit can be safely pushed down through this
UserDefinedLogicalNode node. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for GraphTraversalNode
impl !UnwindSafe for GraphTraversalNode
impl Forget for GraphTraversalNode
impl Freeze for GraphTraversalNode
impl Send for GraphTraversalNode
impl Sync for GraphTraversalNode
impl Unpin for GraphTraversalNode
impl UnsafeUnpin for GraphTraversalNode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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,
Source§impl<T> UserDefinedLogicalNode for Twhere
T: UserDefinedLogicalNodeCore,
impl<T> UserDefinedLogicalNode for Twhere
T: UserDefinedLogicalNodeCore,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Source§fn inputs(&self) -> Vec<&LogicalPlan>
fn inputs(&self) -> Vec<&LogicalPlan>
Source§fn check_invariants(&self, check: InvariantLevel) -> Result<(), DataFusionError>
fn check_invariants(&self, check: InvariantLevel) -> Result<(), DataFusionError>
Source§fn expressions(&self) -> Vec<Expr>
fn expressions(&self) -> Vec<Expr>
Source§fn prevent_predicate_push_down_columns(&self) -> HashSet<String>
fn prevent_predicate_push_down_columns(&self) -> HashSet<String>
Source§fn fmt_for_explain(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt_for_explain(&self, f: &mut Formatter<'_>) -> Result<(), Error>
f for use in explain plan. Read moreSource§fn with_exprs_and_inputs(
&self,
exprs: Vec<Expr>,
inputs: Vec<LogicalPlan>,
) -> Result<Arc<dyn UserDefinedLogicalNode>, DataFusionError>
fn with_exprs_and_inputs( &self, exprs: Vec<Expr>, inputs: Vec<LogicalPlan>, ) -> Result<Arc<dyn UserDefinedLogicalNode>, DataFusionError>
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 moreSource§fn necessary_children_exprs(
&self,
output_columns: &[usize],
) -> Option<Vec<Vec<usize>>>
fn necessary_children_exprs( &self, output_columns: &[usize], ) -> Option<Vec<Vec<usize>>>
Source§fn dyn_eq(&self, other: &dyn UserDefinedLogicalNode) -> bool
fn dyn_eq(&self, other: &dyn UserDefinedLogicalNode) -> bool
Source§fn dyn_ord(&self, other: &dyn UserDefinedLogicalNode) -> Option<Ordering>
fn dyn_ord(&self, other: &dyn UserDefinedLogicalNode) -> Option<Ordering>
other, respecting requirements from PartialOrd.
Must return Some(Equal) if and only if self.dyn_eq(other).Source§fn supports_limit_pushdown(&self) -> bool
fn supports_limit_pushdown(&self) -> bool
true if a limit can be safely pushed down through this
UserDefinedLogicalNode node. Read more