Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove logical cross join in planning #12985

Merged
merged 23 commits into from
Oct 18, 2024
Prev Previous commit
Next Next commit
WIP
Dandandan committed Oct 17, 2024
commit 5b53758ea37a850ebfd0672a6886a3a6e34e0a2c
6 changes: 5 additions & 1 deletion datafusion/sql/src/relation/join.rs
Original file line number Diff line number Diff line change
@@ -151,7 +151,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
.build()
}
}
JoinConstraint::None => not_impl_err!("NONE constraint is not supported"),
JoinConstraint::None => {
LogicalPlanBuilder::from(left)
.join_on(right, join_type, [])?
.build()
}
}
}
}
2 changes: 1 addition & 1 deletion datafusion/sql/tests/cases/plan_to_sql.rs
Original file line number Diff line number Diff line change
@@ -233,7 +233,7 @@ fn roundtrip_crossjoin() -> Result<()> {
.unwrap();

let expected = "Projection: j1.j1_id, j2.j2_string\
\n Inner Join: Filter: Boolean(true)\
\n Cross Join: \
\n TableScan: j1\
\n TableScan: j2";

6 changes: 3 additions & 3 deletions datafusion/sql/tests/sql_integration.rs
Original file line number Diff line number Diff line change
@@ -3154,7 +3154,7 @@ fn lateral_comma_join_referencing_join_rhs() {
\n j1 JOIN (j2 JOIN j3 ON(j2_id = j3_id - 2)) ON(j1_id = j2_id),\
\n LATERAL (SELECT * FROM j3 WHERE j3_string = j2_string) as j4;";
let expected = "Projection: *\
\n Cross Join:\
\n Cross Join: \
\n Inner Join: Filter: j1.j1_id = j2.j2_id\
\n TableScan: j1\
\n Inner Join: Filter: j2.j2_id = j3.j3_id - Int64(2)\
@@ -3178,12 +3178,12 @@ fn lateral_comma_join_with_shadowing() {
) as j2\
) as j2;";
let expected = "Projection: *\
\n Cross Join:\
\n Cross Join: \
\n TableScan: j1\
\n SubqueryAlias: j2\
\n Subquery:\
\n Projection: *\
\n Cross Join:\
\n Cross Join: \
\n TableScan: j1\
\n SubqueryAlias: j2\
\n Subquery:\