LiBinfeng-01 commented on code in PR #39113: URL: https://github.com/apache/doris/pull/39113#discussion_r1712615959
########## fe/fe-core/src/main/java/org/apache/doris/nereids/parser/NereidsParser.java: ########## @@ -290,9 +292,37 @@ public Optional<String> parseForSyncMv(String sql) { return logicalPlanBuilderForSyncMv.getQuerySql(); } + /** get hint map */ + public static Map<Integer, ParserRuleContext> getHintMap(String sql, + Function<DorisParser, ParserRuleContext> parseFunction) { + // parse hint first round + DorisLexer hintLexer = new DorisLexer(new CaseInsensitiveStream(CharStreams.fromString(sql))); + hintLexer.setChannel2(true); + CommonTokenStream hintTokenStream = new CommonTokenStream(hintLexer); Review Comment: getHiddenTokensToRight does not work in this case, I tried to get it but it failed. I try to use List<Token> hintTokens = hintTokenStream.getHiddenTokensToRight(0, 2); but it failed to get token list out from channel2 -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org