fn build_join(
subquery: &Subquery,
filter_input: &LogicalPlan,
subquery_alias: &str,
) -> Result<Option<(LogicalPlan, HashMap<String, Expr>)>>Expand description
Takes a query like:
select id from customers where balance >
(select avg(total) from orders where orders.c_id = customers.id)and optimizes it into:
select c.id from customers c
left join (select c_id, avg(total) as val from orders group by c_id) o on o.c_id = c.c_id
where c.balance > o.valOr a query like:
select id from customers where balance >
(select avg(total) from orders)and optimizes it into:
select c.id from customers c
left join (select avg(total) as val from orders) a
where c.balance > a.valยงArguments
query_info- The subquery portion of thewhere(select avg(total) from orders)filter_input- The non-subquery portion (from customers)outer_others- Any additional parts to thewhereexpression (and c.x = y)subquery_alias- Subquery aliases