mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-01 11:47:20 +00:00
add with/without time zone (#589)
This commit is contained in:
parent
72559e9b62
commit
95fbb55f2c
4 changed files with 37 additions and 5 deletions
|
@ -3119,12 +3119,17 @@ impl<'a> Parser<'a> {
|
|||
Keyword::DATE => Ok(DataType::Date),
|
||||
Keyword::DATETIME => Ok(DataType::Datetime),
|
||||
Keyword::TIMESTAMP => {
|
||||
// TBD: we throw away "with/without timezone" information
|
||||
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)
|
||||
}
|
||||
Keyword::TIMESTAMPTZ => Ok(DataType::TimestampTz),
|
||||
Keyword::TIME => {
|
||||
// TBD: we throw away "with/without timezone" information
|
||||
if self.parse_keyword(Keyword::WITH) || self.parse_keyword(Keyword::WITHOUT) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue