LucaCappelletti94 commented on code in PR #2633:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2633#discussion_r4318291875


##########
src/parser/mod.rs:
##########
@@ -17008,6 +16934,16 @@ impl<'a> Parser<'a> {
             // Stage reference: @mystage or @namespace.stage (e.g. Snowflake)
             self.parse_snowflake_stage_table_factor()
         } else {
+            // Unquoted reserved keywords, e.g. `ON`, are not table names.
+            let peek_keyword = if let Token::Word(w) = 
&self.peek_token_ref().token {
+                w.keyword
+            } else {
+                Keyword::NoKeyword
+            };
+            if !self.dialect.is_table_factor(&peek_keyword, self) {

Review Comment:
   The keyword is now consumed before `is_table_factor` and restored with 
`prev_token()`, the same way as at the trailing comma site.



-- 
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]

Reply via email to