MCPcopy Create free account
hub / github.com/apache/datafusion / node_to_id_array

Method node_to_id_array

datafusion/common/src/cse.rs:534–554  ·  view source on GitHub ↗

Add an identifier to `id_array` for every [`TreeNode`] in this tree.

(
        &self,
        node: &'n N,
        node_stats: &mut NodeStats<'n, N>,
        id_array: &mut IdArray<'n, N>,
    )

Source from the content-addressed store, hash-verified

532
533 /// Add an identifier to `id_array` for every [`TreeNode`] in this tree.
534 fn node_to_id_array<'n>(
535 &self,
536 node: &'n N,
537 node_stats: &mut NodeStats<'n, N>,
538 id_array: &mut IdArray<'n, N>,
539 ) -> Result<bool> {
540 let mut visitor = CSEVisitor {
541 node_stats,
542 id_array,
543 visit_stack: vec![],
544 down_index: 0,
545 up_index: 0,
546 random_state: &self.random_state,
547 found_common: false,
548 conditional: false,
549 controller: &self.controller,
550 };
551 node.visit(&mut visitor)?;
552
553 Ok(visitor.found_common)
554 }
555
556 /// Returns the identifier list for each element in `nodes` and a flag to indicate if
557 /// rewrite phase of CSE make sense.

Callers 2

to_arraysMethod · 0.80
id_array_visitorFunction · 0.80

Calls 1

visitMethod · 0.45

Tested by 1

id_array_visitorFunction · 0.64