avantgardnerio commented on code in PR #4944:
URL: https://github.com/apache/arrow-datafusion/pull/4944#discussion_r1081848407
##########
datafusion/optimizer/src/decorrelate_where_exists.rs:
##########
@@ -116,23 +122,27 @@ impl OptimizerRule for DecorrelateWhereExists {
/// Takes a query like:
///
-/// ```select c.id from customers c where exists (select * from orders o where
o.c_id = c.id)```
+/// SELECT t1.id
+/// FROM t1
+/// WHERE exists
+/// (
+/// SELECT t2.id FROM t2 WHERE t1.id = t2.id
+/// )
///
/// and optimizes it into:
///
-/// ```select c.id from customers c
-/// inner join (select o.c_id from orders o group by o.c_id) o on o.c_id =
c.c_id```
+/// SELECT t1.id
+/// FROM t1 LEFT SEMI
+/// JOIN t2
+/// ON t1.id = t2.id
///
/// # Arguments
///
-/// * subqry - The subquery portion of the `where exists` (select * from
orders)
-/// * negated - True if the subquery is a `where not exists`
-/// * filter_input - The non-subquery portion (from customers)
-/// * outer_exprs - Any additional parts to the `where` expression (and c.x =
y)
+/// * subqry_info - The subquery and negated(exists/not exists) info.
Review Comment:
nit: doc does not match parameter name
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]