You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/07 23:45:17 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #4126: Enable TableProviderFactories to receive additional options when creating an external table

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


##########
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);
+        }

Review Comment:
   I think we need to return an error if we see `OPTIONS` that isn't followed by `(`?
   
   ```suggestion
           self.parser.expect_token(&Token::LParen)?;
   ```



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org