iffyio commented on code in PR #2008: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2008#discussion_r2291362876
########## src/parser/mod.rs: ########## @@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> { } opts }), + Some(Keyword::DATEFORMAT) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] Review Comment: ```suggestion let _ = self.parse_keyword(Keyword::AS); ``` ########## src/parser/mod.rs: ########## @@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> { } opts }), + Some(Keyword::DATEFORMAT) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] + let fmt = if matches!(self.peek_token().token, Token::SingleQuotedString(_)) { + Some(self.parse_literal_string()?) + } else { + None + }; + CopyLegacyOption::DateFormat(fmt) + } + Some(Keyword::DELIMITER) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] + CopyLegacyOption::Delimiter(self.parse_literal_char()?) + } + Some(Keyword::EMPTYASNULL) => CopyLegacyOption::EmptyAsNull, Some(Keyword::IAM_ROLE) => CopyLegacyOption::IamRole(self.parse_iam_role_kind()?), Some(Keyword::IGNOREHEADER) => { let _ = self.parse_keyword(Keyword::AS); let num_rows = self.parse_literal_uint()?; CopyLegacyOption::IgnoreHeader(num_rows) } + Some(Keyword::NULL) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] Review Comment: ```suggestion let _ = self.parse_keyword(Keyword::AS); ``` ########## src/parser/mod.rs: ########## @@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> { } opts }), + Some(Keyword::DATEFORMAT) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] + let fmt = if matches!(self.peek_token().token, Token::SingleQuotedString(_)) { + Some(self.parse_literal_string()?) + } else { + None + }; + CopyLegacyOption::DateFormat(fmt) + } + Some(Keyword::DELIMITER) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] Review Comment: ```suggestion let _ = self.parse_keyword(Keyword::AS); ``` ########## src/parser/mod.rs: ########## @@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> { } opts }), + Some(Keyword::DATEFORMAT) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] + let fmt = if matches!(self.peek_token().token, Token::SingleQuotedString(_)) { + Some(self.parse_literal_string()?) + } else { + None + }; + CopyLegacyOption::DateFormat(fmt) + } + Some(Keyword::DELIMITER) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] + CopyLegacyOption::Delimiter(self.parse_literal_char()?) + } + Some(Keyword::EMPTYASNULL) => CopyLegacyOption::EmptyAsNull, Some(Keyword::IAM_ROLE) => CopyLegacyOption::IamRole(self.parse_iam_role_kind()?), Some(Keyword::IGNOREHEADER) => { let _ = self.parse_keyword(Keyword::AS); let num_rows = self.parse_literal_uint()?; CopyLegacyOption::IgnoreHeader(num_rows) } + Some(Keyword::NULL) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] + CopyLegacyOption::Null(self.parse_literal_string()?) + } + Some(Keyword::TIMEFORMAT) => { + let _ = self.parse_keyword(Keyword::AS); // [ AS ] Review Comment: ```suggestion let _ = self.parse_keyword(Keyword::AS); ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org