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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AT TIME ZONE #539

Merged

Conversation

bitemyapp
Copy link
Contributor

Builds off #532, this time to add support for AT TIME ZONE which appears in multiple SQL dialects including Athena/Presto and MSSQL. There may be others, I haven't bothered to check. I can rebase if #532 gets merged first.

This one was a bit harder. The precedence value is pure guessery: "uhhhh kinda looks like BETWEEN?"

All tests passed locally 馃

@bitemyapp bitemyapp changed the title Add support for at time zone Add support for AT TIME ZONE Jul 14, 2022
Copy link
Collaborator

@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.

The code looks good to me. Once #532 is merged let's rebase this one and merge it in

@@ -285,6 +285,11 @@ pub enum Expr {
expr: Box<Expr>,
data_type: DataType,
},
/// AT a timestamp to a different timezone e.g. `FROM_UNIXTIME(0) AT TIME ZONE 'UTC-06:00'`
Copy link
Collaborator

Choose a reason for hiding this comment

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

@coveralls
Copy link

coveralls commented Jul 18, 2022

Pull Request Test Coverage Report for Build 2691581309

  • 67 of 76 (88.16%) changed or added relevant lines in 4 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 89.923%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/mod.rs 3 5 60.0%
tests/sqlparser_common.rs 34 36 94.44%
src/parser.rs 24 29 82.76%
Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.36%
Totals Coverage Status
Change from base Build 2691250748: 0.002%
Covered Lines: 8995
Relevant Lines: 10003

馃挍 - Coveralls

@bitemyapp bitemyapp force-pushed the bitemyapp/add-support-for-at-time-zone branch from f2a33a7 to 9d12e85 Compare July 18, 2022 15:18
@bitemyapp bitemyapp force-pushed the bitemyapp/add-support-for-at-time-zone branch from 9d12e85 to 0a897d2 Compare July 18, 2022 15:19
@bitemyapp
Copy link
Contributor Author

@alamb rebases all around, fmt issues should be fixed now.

@alamb
Copy link
Collaborator

alamb commented Jul 18, 2022

Thank you @bitemyapp !

@alamb alamb merged commit 7cbbd91 into sqlparser-rs:main Jul 18, 2022
@bitemyapp bitemyapp deleted the bitemyapp/add-support-for-at-time-zone branch July 20, 2022 16:39
mobuchowski pushed a commit to mobuchowski/sqlparser-rs that referenced this pull request Aug 3, 2022
* Support for empty array literals

* Added support for AT TIME ZONE

Co-authored-by: Chris Allen <chrisa@indeed.com>
gandronchik pushed a commit to cube-js/sqlparser-rs that referenced this pull request Sep 6, 2022
* Support for empty array literals

* Added support for AT TIME ZONE

Co-authored-by: Chris Allen <chrisa@indeed.com>

qwe
gandronchik pushed a commit to cube-js/sqlparser-rs that referenced this pull request Sep 6, 2022
* Support for empty array literals

* Added support for AT TIME ZONE

Co-authored-by: Chris Allen <chrisa@indeed.com>

qwe
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.

None yet

3 participants