yoavcloud commented on code in PR #1712: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1712#discussion_r1947546222
########## src/dialect/snowflake.rs: ########## @@ -120,6 +120,12 @@ impl Dialect for SnowflakeDialect { } fn parse_statement(&self, parser: &mut Parser) -> Option<Result<Statement, ParserError>> { + if parser.parse_keywords(&[Keyword::ALTER, Keyword::SESSION]) { + // ALTER SESSION + let set = parser.parse_keyword(Keyword::SET) | !parser.parse_keyword(Keyword::UNSET); Review Comment: This would accept any statements that are not acceptable by Snowflake such as `ALTER SESSION XYZ`. Suggest to rewrite as: ```rust let set = match parser.parse_one_of_keywords(&[Keyword::SET, Keyword::UNSET]) { Some(Keyword::SET) => true, Some(Keyword::UNSET) => false, _ => return Some(parser.expected("SET or UNSET", parser.peek_token())) }; ``` -- 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