Jackie-Jiang commented on a change in pull request #7869:
URL: https://github.com/apache/pinot/pull/7869#discussion_r763295703



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -744,7 +746,11 @@ private static void applyAlias(Map<Identifier, Expression> 
aliasMap, Expression
 
   private static List<String> extractOptionsFromSql(String sql) {
     List<String> results = new ArrayList<>();
-    Matcher matcher = OPTIONS_REGEX_PATTEN.matcher(sql);
+    Matcher matcher = COMMENTED_QUERY_PATTERN.matcher(sql);
+    if (matcher.find()) {

Review comment:
       This will ignore all the options if any line of the sql is commented out.
   
   We should only ignore the options within the commented out part, so the 
options should not be ignored in this query:
   `select ... option(...) -- commented out`
   
   Some other corner cases not handled are (not necessary handle in this PR, 
but might worth add a TODO):
   `option()` within literal or identifier




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