walterddr commented on code in PR #9017:
URL: https://github.com/apache/pinot/pull/9017#discussion_r918485612


##########
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java:
##########
@@ -105,66 +106,80 @@ private static String removeTerminatingSemicolon(String 
sql) {
   }
 
   public static SqlNodeAndOptions compileToSqlNodeAndOptions(String sql)
-      throws Exception {
+      throws SqlCompilationException {
     // Remove the comments from the query
     sql = removeComments(sql);
 
     // Remove the terminating semicolon from the query
     sql = removeTerminatingSemicolon(sql);
 
-    // Extract OPTION statements from sql as Calcite Parser doesn't parse it.
+    // extract and remove OPTIONS string
     List<String> options = extractOptionsFromSql(sql);
-    if (!options.isEmpty()) {
-      sql = removeOptionsFromSql(sql);
-    }
+    sql = removeOptionsFromSql(sql);

Review Comment:
   ```suggestion
       if (!options.isEmpty()) {
         sql = removeOptionsFromSql(sql);
       }
   ```



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