LiaCastaneda commented on code in PR #22530:
URL: https://github.com/apache/datafusion/pull/22530#discussion_r3323031519


##########
datafusion/optimizer/src/scalar_subquery_to_join.rs:
##########
@@ -1159,4 +1197,53 @@ mod tests {
         "
         )
     }
+
+    #[test]
+    fn uncorrelated_scalar_subquery_rewritten_when_flag_off() -> Result<()> {
+        use datafusion_common::config::ConfigOptions;
+
+        let sq = Arc::new(
+            LogicalPlanBuilder::from(scan_tpch_table("orders"))
+                .aggregate(Vec::<Expr>::new(), 
vec![max(col("orders.o_custkey"))])?
+                .project(vec![max(col("orders.o_custkey"))])?
+                .build()?,
+        );
+
+        let plan = LogicalPlanBuilder::from(scan_tpch_table("customer"))
+            .filter(col("customer.c_custkey").eq(scalar_subquery(sq)))?
+            .project(vec![col("customer.c_custkey")])?
+            .build()?;
+
+        let mut options = ConfigOptions::default();
+        options.optimizer.filter_null_join_keys = true;

Review Comment:
   yep it's copy paste, we can remove it



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

Reply via email to