DhamoPS commented on code in PR #3334: URL: https://github.com/apache/arrow-datafusion/pull/3334#discussion_r961922131
########## datafusion/core/tests/sql/subqueries.rs: ########## @@ -288,6 +288,71 @@ async fn tpch_q17_correlated() -> Result<()> { Ok(()) } +// Fix for issue#78 join predicates from inside of OR expr also pulled up properly. +#[tokio::test] +async fn tpch_q19_pull_predicates_to_innerjoin_simplified() -> Result<()> { + let ctx = SessionContext::new(); + + register_tpch_csv(&ctx, "part").await?; + register_tpch_csv(&ctx, "lineitem").await?; + register_tpch_csv(&ctx, "partsupp").await?; + + let sql = r#" +select + p_partkey, + sum(l_extendedprice), + avg(l_discount), + count(distinct ps_suppkey) +from + lineitem, + part, + partsupp +where + ( + p_partkey = l_partkey + and p_brand = 'Brand#12' Review Comment: In that scenario, we don't lift the predicate up. I have tested the behavior by running the modified tests. -- 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...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org