JasonLi-cn commented on code in PR #13184: URL: https://github.com/apache/datafusion/pull/13184#discussion_r1827195991
########## datafusion/optimizer/src/push_down_filter.rs: ########## @@ -429,41 +434,63 @@ fn push_down_all_join( let mut keep_predicates = vec![]; let mut join_conditions = vec![]; let mut checker = ColumnChecker::new(left_schema, right_schema); + for predicate in predicates { - if left_preserved && checker.is_left_only(&predicate) { + let columns = predicate.column_refs(); + macro_rules! restrict_null { + () => {{ + let predicate_cloned = predicate.clone(); + let cols = columns.iter().cloned(); + is_restrict_null_predicate(predicate_cloned, cols).unwrap_or(false) + }}; + } + + if checker.left_only(&columns) && (left_preserved || restrict_null!()) { left_push.push(predicate); - } else if right_preserved && checker.is_right_only(&predicate) { + } else if checker.right_only(&columns) && (right_preserved || restrict_null!()) { Review Comment: Yes, this is wrong. I neglected to modify JoinType here. Thank you @eejbyfeldt for your help in finding this problem. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org