wugeer commented on code in PR #1630:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1630#discussion_r1905597631
##########
src/parser/mod.rs:
##########
@@ -2353,14 +2355,30 @@ impl<'a> Parser<'a> {
};
Ok(DateTimeField::Week(week_day))
}
+ Keyword::WEEKS => {
+ let week_day = if dialect_of!(self is BigQueryDialect)
+ && self.consume_token(&Token::LParen)
+ {
+ let week_day = self.parse_identifier()?;
+ self.expect_token(&Token::RParen)?;
+ Some(week_day)
+ } else {
+ None
+ };
+ Ok(DateTimeField::Weeks(week_day))
+ }
Review Comment:
@iffyio I found the following dialects supported pluralized time units.But
the is interesting thing is that not all dialects support `weeks`.
snowflake
https://docs.snowflake.com/en/sql-reference/data-types-datetime#interval-examples
hive
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27838462#LanguageManualTypes-Intervals
postgres
https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
redshift
https://docs.aws.amazon.com/redshift/latest/dg/r_interval_data_types.html#r_interval_data_types-arguments
duckdb https://duckdb.org/docs/sql/data_types/interval.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]