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

Method exists

datafusion/common/src/tree_node.rs:397–408  ·  view source on GitHub ↗

Returns true if `f` returns true for any node in the tree. Stops recursion as soon as a matching node is found

(&self, mut f: F)

Source from the content-addressed store, hash-verified

395 ///
396 /// Stops recursion as soon as a matching node is found
397 fn exists<F: FnMut(&Self) -> Result<bool>>(&self, mut f: F) -> Result<bool> {
398 let mut found = false;
399 self.apply(|n| {
400 Ok(if f(n)? {
401 found = true;
402 TreeNodeRecursion::Stop
403 } else {
404 TreeNodeRecursion::Continue
405 })
406 })
407 .map(|_| found)
408 }
409
410 /// Low-level API used to implement other APIs.
411 ///

Callers 15

check_async_udfFunction · 0.80
any_column_refsMethod · 0.80
contains_outerMethod · 0.80
is_volatileMethod · 0.80
url_from_filesystem_pathFunction · 0.80
criterion_benchmarkFunction · 0.80
compute_library_dirFunction · 0.80
find_cdylibFunction · 0.80
setup_scratch_dirFunction · 0.80

Implementers 3

tree_node.rsdatafusion/expr/src/tree_node.rs
tree_node.rsdatafusion/expr/src/logical_plan/tree_
tree_node.rsdatafusion/common/src/tree_node.rs

Calls 2

mapMethod · 0.45
applyMethod · 0.45

Tested by 4

compute_library_dirFunction · 0.64
find_cdylibFunction · 0.64
setup_scratch_dirFunction · 0.64