iffyio commented on code in PR #1675:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1675#discussion_r1925549414


##########
src/parser/mod.rs:
##########
@@ -8888,6 +8888,64 @@ impl<'a> Parser<'a> {
         }
     }
 
+    pub fn parse_table_index_hints(&mut self) -> Result<Vec<TableIndexHints>, 
ParserError> {

Review Comment:
   ```suggestion
       fn parse_table_index_hints(&mut self) -> Result<Vec<TableIndexHints>, 
ParserError> {
   ```
   I wonder if we need to have this function public, if we do feel free to 
leave as is and we can also include a doc string describing its behavior in 
that case?



##########
src/parser/mod.rs:
##########
@@ -8888,6 +8888,64 @@ impl<'a> Parser<'a> {
         }
     }
 
+    pub fn parse_table_index_hints(&mut self) -> Result<Vec<TableIndexHints>, 
ParserError> {
+        let mut hints = vec![];
+        while let Some(hint_type) =
+            self.parse_one_of_keywords(&[Keyword::USE, Keyword::IGNORE, 
Keyword::FORCE])

Review Comment:
   Given the following which is valid BigQuery for example `SELECT * FROM T USE 
LIMIT 1` - it seems such queries will fail to parse with the current impl? If 
so, `self.maybe_parse` might be useful here to try to lookahead to parse a hint 
and keep going on failure. Also it would be good to test the behavior on mysql 
and another dialect (e.g. BigQuery) that doesn't support index hints



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