avantgardnerio commented on code in PR #3334:
URL: https://github.com/apache/arrow-datafusion/pull/3334#discussion_r961917766
##########
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:
My question about disjunctions can be rephrased as "what if this `and` was
an `or`? would we still try to lift it out into a join predicate?"
--
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]