kumarUjjawal commented on code in PR #27544: URL: https://github.com/apache/datafusion/pull/27544#discussion_r4609719922
########## datafusion/optimizer/src/rewrite_set_comparison.rs: ########## Review Comment: https://github.com/apache/datafusion/blob/6a526c6d9e46b8a74d922b779a425ea2c80abf9f/datafusion/optimizer/src/rewrite_set_comparison.rs#L108 `true_exists` is built before the quantifier match, so the `All` arm builds it and never uses it; `exists_subquery` copies the whole subquery plan (`subquery.subquery.as_ref().clone()`) and wraps it in a Filter just to throw it away. ########## datafusion/optimizer/src/decorrelate_predicate_subquery.rs: ########## Review Comment: https://github.com/apache/datafusion/blob/6a526c6d9e46b8a74d922b779a425ea2c80abf9f/datafusion/optimizer/src/decorrelate_predicate_subquery.rs#L1328 missed two redundant clones in the function it edits: `pull_up_having_expr` is owned on line 1300 but is turned into a reference on line 1313, so `having_arm` (line 1328) and `unmatched_having_default` (line 1338) each clone the HAVING expression. ########## datafusion/optimizer/src/decorrelate_predicate_subquery.rs: ########## Review Comment: https://github.com/apache/datafusion/blob/6a526c6d9e46b8a74d922b779a425ea2c80abf9f/datafusion/optimizer/src/decorrelate_predicate_subquery.rs#L1353 says EXISTS is true "unless one of three cases holds" but lists only two cases. -- 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]
