alamb commented on code in PR #13496:
URL: https://github.com/apache/datafusion/pull/13496#discussion_r1855189743


##########
datafusion/sql/tests/cases/plan_to_sql.rs:
##########
@@ -1153,7 +1153,7 @@ fn test_join_with_table_scan_filters() -> Result<()> {
 
     let sql = plan_to_sql(&join_plan_multiple_filters)?;
 
-    let expected_sql = r#"SELECT * FROM left_table AS "left" JOIN right_table 
ON "left".id = right_table.id AND (("left".id > 5) AND (("left"."name" LIKE 
'some_name' AND (right_table."name" = 'before_join_filter_val')) AND (age > 
10))) WHERE ("left"."name" = 'after_join_filter_val')"#;
+    let expected_sql = r#"SELECT * FROM left_table AS "left" JOIN right_table 
ON "left".id = right_table.id AND ("left".id > 5) WHERE ("left"."name" = 
'after_join_filter_val') AND "left"."name" LIKE 'some_name' AND 
((right_table."name" = 'before_join_filter_val') AND (right_table.age > 10))"#;

Review Comment:
   Filtering after join is (semantically) the same as filtering before/during 
joins only for `INNER JOIN` / `JOIN`
   
   You are correct that for `LEFT/RIGHT/FULL OUTER JOIN`  and `SEMI/ANTI JOIN` 
the rules are more subtle



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

Reply via email to