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

Function find_join_exprs

datafusion/expr/src/utils.rs:1264–1280  ·  view source on GitHub ↗

Looks for correlating expressions: for example, a binary expression with one field from the subquery, and one not in the subquery (closed upon from outer scope) # Arguments `exprs` - List of expressions that may or may not be joins # Return value Tuple of (expressions containing joins, remaining non-join expressions)

(exprs: Vec<&Expr>)

Source from the content-addressed store, hash-verified

1262///
1263/// Tuple of (expressions containing joins, remaining non-join expressions)
1264pub fn find_join_exprs(exprs: Vec<&Expr>) -> Result<(Vec<Expr>, Vec<Expr>)> {
1265 let mut joins = vec![];
1266 let mut others = vec![];
1267 for filter in exprs.into_iter() {
1268 // If the expression contains correlated predicates, add it to join filters
1269 if filter.contains_outer() {
1270 if !matches!(filter, Expr::BinaryExpr(BinaryExpr{ left, op: Operator::Eq, right }) if left.eq(right))
1271 {
1272 joins.push(strip_outer_reference((*filter).clone()));
1273 }
1274 } else {
1275 others.push((*filter).clone());
1276 }
1277 }
1278
1279 Ok((joins, others))
1280}
1281
1282/// Returns the first (and only) element in a slice, or an error
1283///

Callers 1

f_upMethod · 0.85

Calls 5

strip_outer_referenceFunction · 0.85
contains_outerMethod · 0.80
into_iterMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…