macroguo-ghy commented on code in PR #3377:
URL: https://github.com/apache/calcite/pull/3377#discussion_r1299380926
##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -1335,7 +1335,7 @@ SqlSelect SqlSelect() :
}
{
<SELECT> { s = span(); }
- [ <HINT_BEG> AddHint(hints) ( <COMMA> AddHint(hints) )* <COMMENT_END> ]
+ [ <HINT_BEG> (AddHint(hints))? ( <COMMA> AddHint(hints) )* <COMMENT_END> ]
Review Comment:
I think hint start with COMMA is illegal syntax, but your change will allow
it to pass during parsing.
For example `select /*+ , hint1 */`
##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -1335,7 +1335,7 @@ SqlSelect SqlSelect() :
}
{
<SELECT> { s = span(); }
- [ <HINT_BEG> AddHint(hints) ( <COMMA> AddHint(hints) )* <COMMENT_END> ]
+ [ <HINT_BEG> (AddHint(hints))? ( <COMMA> AddHint(hints) )* <COMMENT_END> ]
Review Comment:
Calcite also supports `TableHints`, so you will also need to modify it
accordingly. WDYT?
--
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]