-
Notifications
You must be signed in to change notification settings - Fork 606
Change TIMESTAMP
and TIME
parsing so that time zone information is preserved
#641
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
Change TIMESTAMP
and TIME
parsing so that time zone information is preserved
#641
Conversation
Pull Request Test Coverage Report for Build 3174140375
💛 - Coveralls |
cc @waitingkuo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fix comment typo
TIMESTAMP
and TIME
parsing so that time zone information is preserved
@alamb @AugustoFKL I just reviewed the codes, it looks great! 👍 i'll file a issue to datafusion to align with this |
…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 <[email protected]>
Fixing
TIME
andTIMESTAMP
printing 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 ZONE
equals addingTZ
to the name. I.e.:TIMESTAMP WITH TIME ZONE
toTIMESTMAPTZ
. 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