MartinSahlen commented on code in PR #1657:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1657#discussion_r1917876805


##########
src/parser/mod.rs:
##########
@@ -7341,6 +7341,10 @@ impl<'a> Parser<'a> {
     pub fn parse_options(&mut self, keyword: Keyword) -> 
Result<Vec<SqlOption>, ParserError> {
         if self.parse_keyword(keyword) {
             self.expect_token(&Token::LParen)?;
+            if self.peek_token() == Token::RParen {
+                self.next_token();
+                return Ok(vec![]);
+            }
             let options = 
self.parse_comma_separated(Parser::parse_sql_option)?;
             self.expect_token(&Token::RParen)?;

Review Comment:
   I was not aware of this one, but it seems to break here:
   ```
   thread 'test_bigquery_create_function' panicked at src/test_utils.rs:155:61:
   CREATE OR REPLACE TEMPORARY FUNCTION project1.mydataset.myfunction(x 
FLOAT64) RETURNS FLOAT64 OPTIONS(x = 'y') AS 42: ParserError("Expected: AS, 
found: )")
   ```
   
   when it looks like this
   ```rust
     pub fn parse_options(&mut self, keyword: Keyword) -> 
Result<Vec<SqlOption>, ParserError> {
           if self.parse_keyword(keyword) {
               self.expect_token(&Token::LParen)?;
               let options = 
self.parse_comma_separated0(Parser::parse_sql_option, Token::RParen)?;
               Ok(options)
           } else {
               Ok(vec![])
           }
       }
   
   ```
   
   I will work a bit to see what is going wrong



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

Reply via email to