datafusion_optimizer::analyzer::subquery

Function check_subquery_expr

Source
pub fn check_subquery_expr(
    outer_plan: &LogicalPlan,
    inner_plan: &LogicalPlan,
    expr: &Expr,
) -> Result<()>
Expand description

Do necessary check on subquery expressions and fail the invalid plan

  1. Check whether the outer plan is in the allowed outer plans list to use subquery expressions, the allowed while list: [Projection, Filter, Window, Aggregate, Join].
  2. Check whether the inner plan is in the allowed inner plans list to use correlated(outer) expressions.
  3. Check and validate unsupported cases to use the correlated(outer) expressions inside the subquery(inner) plans/inner expressions. For example, we do not want to support to use correlated expressions as the Join conditions in the subquery plan when the Join is a Full Out Join