Skip to content

feat: Support PostgreSQL exponentiation. #813

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

Merged
merged 8 commits into from
Mar 2, 2023
Merged

Conversation

michael-2956
Copy link
Contributor

As of current version, SELECT 3 ^ 4 in the PostgreSQL dialect reads as BinaryOperator::BitwiseXor, while it should read as the exponentiation operation. I added BinaryOperator::PGExp for that purpose and completed all the tests in this pull request.

@coveralls
Copy link

coveralls commented Feb 24, 2023

Pull Request Test Coverage Report for Build 4312856330

  • 16 of 17 (94.12%) changed or added relevant lines in 4 files are covered.
  • 827 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.03%) to 86.173%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 4 5 80.0%
Files with Coverage Reduction New Missed Lines %
tests/sqlparser_common.rs 1 97.32%
tests/sqlparser_bigquery.rs 8 96.24%
src/ast/value.rs 10 85.88%
src/ast/query.rs 31 85.84%
src/tokenizer.rs 91 89.25%
src/ast/mod.rs 272 78.14%
src/parser.rs 414 83.21%
Totals Coverage Status
Change from base Build 4216963554: 0.03%
Covered Lines: 13493
Relevant Lines: 15658

💛 - Coveralls

@michael-2956 michael-2956 changed the title Support PostgreSQL exponentiation. feat: Support PostgreSQL exponentiation. Feb 24, 2023
@michael-2956 michael-2956 requested a review from ankrgyl March 1, 2023 13:47
Copy link
Contributor

@ankrgyl ankrgyl left a comment

Choose a reason for hiding this comment

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

@AugustoFKL @alamb this change looks pretty good to me minus the couple small comments I left.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @michael-2956 -- I agree with @ankrgyl 's comments. After they are done I think this PR is ready to go.

@michael-2956 michael-2956 requested a review from alamb March 2, 2023 10:13
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @michael-2956

@alamb alamb merged commit 1cf913e into apache:main Mar 2, 2023
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.

4 participants