mohammadnaqvi04 commented on code in PR #26677:
URL: https://github.com/apache/datafusion/pull/26677#discussion_r4368222695


##########
datafusion/optimizer/src/decorrelate_predicate_subquery.rs:
##########
@@ -854,6 +854,35 @@ fn build_join(
     if !pull_up.can_pull_up {
         return Ok(None);
     }
+    // Stopgap until a follow-up adds count-bug compensation for `IN`/`NOT IN`.
+    // The subquery stays correlated unless an outer row with no match gets the
+    // right answer anyway.
+    if !exists_sub_query {

Review Comment:
   This makes sense. The second pass can't find anything when 
`pulled_up_scalar_agg` isn't set. Done.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to