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

SUPPORT SEMI/ANTI JOIN syntax #723

Merged
merged 1 commit into from Nov 30, 2022
Merged

Conversation

mingmwang
Copy link
Contributor

Closes #712

Some of SQL engines support SEMI/ANTI JOIN syntax explicitly. This PR adds this support to sqlparser-rs.

match kw {
Keyword::LEFT => JoinOperator::LeftOuter,
Keyword::RIGHT => JoinOperator::RightOuter,
_ => unreachable!(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mingmwang for this and all the next unreachable!(). Even if this is really unreachable, please try to add an error here, or handle it in a different way. Being unsafe is not really good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the unreachable!() is used in other places in the code base. I just follow the same
code style.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it can have only two values, we can also make it a boolean value. I plan to merge this PR and then I will submit a follow on to remove the use of unreachable!

@mingmwang mingmwang changed the title SUPPRT SEMI/ANTI JOIN syntax SUPPORT SEMI/ANTI JOIN syntax Nov 22, 2022
match kw {
Keyword::LEFT => JoinOperator::LeftOuter,
Keyword::RIGHT => JoinOperator::RightOuter,
_ => unreachable!(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it can have only two values, we can also make it a boolean value. I plan to merge this PR and then I will submit a follow on to remove the use of unreachable!

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3512324437

  • 56 of 76 (73.68%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.07%) to 86.202%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/query.rs 12 20 60.0%
src/parser.rs 20 32 62.5%
Totals Coverage Status
Change from base Build 3448124733: -0.07%
Covered Lines: 11858
Relevant Lines: 13756

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does sqlparser-rs support Left Semi/Left Anti/Right Semi/Right Anti Join ?
4 participants