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>)
| 1262 | /// |
| 1263 | /// Tuple of (expressions containing joins, remaining non-join expressions) |
| 1264 | pub 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 | /// |
no test coverage detected
searching dependent graphs…