mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-16 04:54:59 +00:00
Support SEMI/ANTI JOIN syntax (#723)
This commit is contained in:
parent
1f22ea74ae
commit
96bca38fae
4 changed files with 118 additions and 7 deletions
|
@ -3868,6 +3868,22 @@ fn parse_joins_on() {
|
|||
only(&verified_only_select("SELECT * FROM t1 RIGHT JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::RightOuter)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 LEFT SEMI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::LeftSemi)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 RIGHT SEMI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::RightSemi)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 LEFT ANTI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::LeftAnti)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 RIGHT ANTI JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::RightAnti)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 FULL JOIN t2 ON c1 = c2").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::FullOuter)]
|
||||
|
@ -3917,6 +3933,22 @@ 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 LEFT SEMI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::LeftSemi)]
|
||||
);
|
||||
assert_eq!(
|
||||
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 LEFT ANTI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::LeftAnti)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 RIGHT ANTI JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::RightAnti)]
|
||||
);
|
||||
assert_eq!(
|
||||
only(&verified_only_select("SELECT * FROM t1 FULL JOIN t2 USING(c1)").from).joins,
|
||||
vec![join_with_constraint("t2", None, JoinOperator::FullOuter)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue