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


##########
datafusion/optimizer/src/decorrelate.rs:
##########


Review Comment:
   Fixed by reworking `build_join` to retry the rewrite without compensation 
when it isn't safe to use. It computes `compensable` (count map present, or no 
`pull_up_having_expr` to lose) and re-runs `PullUpCorrelatedExpr` with 
`handle_count_bug: false` when that's false, so the HAVING falls back to being 
restored as a normal filter instead of silently vanishing. Verified against 
your repro, this now matches main's (incorrect) answer.



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