xitep commented on code in PR #2162:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2162#discussion_r2727019526


##########
src/parser/mod.rs:
##########
@@ -14005,6 +14015,59 @@ impl<'a> Parser<'a> {
         })
     }
 
+    /// Parses an optional optimizer hint at the current token position
+    ///
+    /// 
[MySQL](https://dev.mysql.com/doc/refman/8.4/en/optimizer-hints.html#optimizer-hints-overview)
+    /// 
[Oracle](https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Comments.html#GUID-D316D545-89E2-4D54-977F-FC97815CD62E)
+    fn parse_optional_optimizer_hint(&mut self) -> 
Result<Option<OptimizerHint>, ParserError> {
+        let supports_multiline = dialect_of!(self is MySqlDialect | 
OracleDialect | GenericDialect);
+        let supports_singleline = dialect_of!(self is OracleDialect | 
GenericDialect);
+        if !supports_multiline && !supports_singleline {
+            return Ok(None);
+        }
+        loop {
+            let t = self.peek_nth_token_no_skip_ref(0);
+            match &t.token {
+                // ~ only the very first comment

Review Comment:
   i'll revise the comment; it's that only the first comment appearing right 
after the SELECT, INSERT... keywords can be a valid hint.



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