mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 14:28:22 +00:00
Support ANTI and SEMI joins without LEFT/RIGHT (#1528)
This commit is contained in:
parent
4a5f20e911
commit
a67a4f3cbe
4 changed files with 46 additions and 0 deletions
|
@ -6013,6 +6013,10 @@ fn parse_joins_on() {
|
|||
JoinOperator::RightOuter
|
||||
)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 SEMI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, false, JoinOperator::Semi)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 LEFT SEMI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint(
|
||||
|
@ -6031,6 +6035,10 @@ fn parse_joins_on() {
|
|||
JoinOperator::RightSemi
|
||||
)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 ANTI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, false, JoinOperator::Anti)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 LEFT ANTI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint(
|
||||
|
@ -6117,6 +6125,10 @@ fn parse_joins_using() {
|
|||
only(&verified_only_select("SELECT * FROM t1 RIGHT JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::RightOuter)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 SEMI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::Semi)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 LEFT SEMI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::LeftSemi)]
|
||||
|
@ -6125,6 +6137,10 @@ fn parse_joins_using() {
|
|||
only(&verified_only_select("SELECT * FROM t1 RIGHT SEMI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::RightSemi)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 ANTI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::Anti)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 LEFT ANTI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::LeftAnti)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue