Change TIMESTAMP and TIME parsing so that time zone information is preserved#641
Merged
alamb merged 3 commits intoapache:mainfrom Oct 3, 2022
AugustoFKL:640_timestmap-and-time-time-zone-correct-usage
Merged
Change TIMESTAMP and TIME parsing so that time zone information is preserved#641alamb merged 3 commits intoapache:mainfrom AugustoFKL:640_timestmap-and-time-time-zone-correct-usage
TIMESTAMP and TIME parsing so that time zone information is preserved#641alamb merged 3 commits intoapache:mainfrom
AugustoFKL:640_timestmap-and-time-time-zone-correct-usage
Conversation
Pull Request Test Coverage Report for Build 3174140375
💛 - Coveralls |
Contributor
|
cc @waitingkuo |
alamb
reviewed
Oct 3, 2022
alamb
approved these changes
Oct 3, 2022
Contributor
alamb
left a comment
There was a problem hiding this comment.
This looks great -- thank you @AugustoFKL
| assert_eq!(data_type, expected); | ||
| let data_type = parser.parse_data_type().unwrap(); | ||
| assert_eq!(data_type, expected_type); | ||
| assert_eq!(expected_type.to_string(), expected_str.to_string()); |
Fix comment typo
TIMESTAMP and TIME parsing so that time zone information is preserved
Contributor
|
@alamb @AugustoFKL I just reviewed the codes, it looks great! 👍 i'll file a issue to datafusion to align with this |
ovr
pushed a commit
to cube-js/sqlparser-rs
that referenced
this pull request
Mar 21, 2023
…s preserved (apache#641) * 640 Fixing time zone printing format for TIMESTAMP and TIME * 640 Removing unnecessary changes * Update src/ast/data_type.rs Fix comment typo Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing
TIMEandTIMESTAMPprinting considering the input (1), instead of assuming that:WITHOUT TIME ZONE(the standard recommends this, but may not be followed by all dialects)WITH TIME ZONEequals addingTZto the name. I.e.:TIMESTAMP WITH TIME ZONEtoTIMESTMAPTZ. For example, Oracle doesn't apply that logic (2), but PostgreSQL does (3).[1] : https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#datetime-type
[2] : https://docs.oracle.com/en/database/oracle/oracle-database/12.2/nlspg/datetime-data-types-and-time-zone-support.html#GUID-3F1C388E-C651-43D5-ADBC-1A49E5C2CA05
[3] : https://www.postgresql.org/docs/current/datatype-datetime.html
Resolves: #640
Fixes: #589