andygrove commented on code in PR #4126:
URL: https://github.com/apache/arrow-datafusion/pull/4126#discussion_r1016011698


##########
datafusion/sql/src/parser.rs:
##########
@@ -381,6 +391,37 @@ impl<'a> DFParser<'a> {
         }
     }
 
+    fn parse_has_options(&mut self) -> bool {
+        self.consume_token(&Token::make_keyword("OPTIONS"))
+    }
+
+    //
+    fn parse_options(&mut self) -> Result<HashMap<String, String>, 
ParserError> {
+        let mut options: HashMap<String, String> = HashMap::new();
+        if !self.parser.consume_token(&Token::LParen)
+            || self.parser.consume_token(&Token::RParen)
+        {
+            return Ok(options);
+        }
+
+        loop {
+            let key = self.parser.parse_literal_string()?;
+            let value = self.parser.parse_literal_string()?;
+            options.insert(key.to_string(), value.to_string());
+            let comma = self.parser.consume_token(&Token::Comma);
+            if self.parser.consume_token(&Token::RParen) {
+                // allow a trailing comma, even though it's not in standard
+                break;
+            } else if !comma {
+                return self.expected(
+                    "',' or ')' after partition definition",

Review Comment:
   ```suggestion
                       "',' or ')' after option definition",
   ```



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

Reply via email to