-
Notifications
You must be signed in to change notification settings - Fork 558
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
add with/without time zone #589
Conversation
DataType::Timestamp => write!(f, "TIMESTAMP"), | ||
DataType::TimestampTz => write!(f, "TIMESTAMPTZ"), |
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.
add DataType::TimestampTz
if self.parse_keyword(Keyword::WITH) || self.parse_keyword(Keyword::WITHOUT) { | ||
if self.parse_keyword(Keyword::WITH) { | ||
self.expect_keywords(&[Keyword::TIME, Keyword::ZONE])?; | ||
Ok(DataType::TimestampTz) | ||
} else if self.parse_keyword(Keyword::WITHOUT) { | ||
self.expect_keywords(&[Keyword::TIME, Keyword::ZONE])?; | ||
Ok(DataType::Timestamp) | ||
} else { | ||
Ok(DataType::Timestamp) | ||
} | ||
Ok(DataType::Timestamp) | ||
} |
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.
enable with time zone
and without time zone
} | ||
Keyword::TIMESTAMPTZ => Ok(DataType::TimestampTz), |
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.
add TimestampTz into parser
Pull Request Test Coverage Report for Build 2910912498
💛 - Coveralls |
@liukun4515 @alamb this is to add time zone support for sql parser we need this to solve time-zone related issue in apache/datafusion#3148 |
I need some time to get familiar with the context in the datafusion/arrow-rs. @waitingkuo Maybe be slower to reply |
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.
LGTM. Thanks @waitingkuo
@waitingkuo @andygrove |
close #588
close #464
add datetype
TimestampTz
add following into parser
TIMESTAMP [WITHOUT TIME ZONE]
=>Timestamp
TIMESTAMP WITH TIME ZONE
andTIMESTAMPTZ
=> `TimestampTz