alamb commented on code in PR #2421:
URL: https://github.com/apache/arrow-datafusion/pull/2421#discussion_r864852539
##########
datafusion/core/src/optimizer/subquery_filter_to_join.rs:
##########
@@ -220,15 +220,15 @@ mod tests {
fn in_subquery_simple() -> Result<()> {
let table_scan = test_table_scan()?;
let plan = LogicalPlanBuilder::from(table_scan)
- .filter(in_subquery(col("c"), test_subquery()?))?
+ .filter(in_subquery(col("c"), test_subquery_with_name("sq")?))?
.project(vec![col("test.b")])?
.build()?;
let expected = "Projection: #test.b [b:UInt32]\
- \n Semi Join: #test.c = #test.c [a:UInt32, b:UInt32, c:UInt32]\
+ \n Semi Join: #test.c = #sq.c [a:UInt32, b:UInt32, c:UInt32]\
Review Comment:
much easier to read -- thank you
##########
datafusion/core/src/optimizer/subquery_filter_to_join.rs:
##########
@@ -320,13 +346,42 @@ mod tests {
.build()?;
let expected = "Projection: #test.b [b:UInt32]\
- \n Semi Join: #test.b = #test.a [a:UInt32, b:UInt32, c:UInt32]\
+ \n Semi Join: #test.b = #sq.a [a:UInt32, b:UInt32, c:UInt32]\
\n TableScan: test projection=None [a:UInt32, b:UInt32, c:UInt32]\
- \n Projection: #test.a [a:UInt32]\
- \n Semi Join: #test.a = #test.c [a:UInt32, b:UInt32, c:UInt32]\
+ \n Projection: #sq.a [a:UInt32]\
+ \n Semi Join: #sq.a = #sq_nested.c [a:UInt32, b:UInt32, c:UInt32]\
+ \n TableScan: sq projection=None [a:UInt32, b:UInt32, c:UInt32]\
+ \n Projection: #sq_nested.c [c:UInt32]\
+ \n TableScan: sq_nested projection=None [a:UInt32, b:UInt32,
c:UInt32]";
+
+ assert_optimized_plan_eq(&plan, expected);
+ Ok(())
+ }
+
+ /// Test for filter input modification in case filter not supported
+ /// Outer filter expression not modified while inner converted to join
Review Comment:
👍
--
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]