weixiangsun commented on a change in pull request #8029:
URL: https://github.com/apache/pinot/pull/8029#discussion_r787319394
##########
File path:
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -117,21 +117,50 @@ private static String removeTerminatingSemicolon(String
sql) {
return sql;
}
+ private static SqlNode parse(String sql) {
+ SqlParser sqlParser = SqlParser.create(sql, PARSER_CONFIG);
+ try {
+ return sqlParser.parseQuery();
+ } catch (SqlParseException e) {
+ throw new SqlCompilationException("Caught exception while parsing query:
" + sql, e);
+ }
+ }
+
+ public static PinotQuery compileToPinotQueryWithSubquery(String sql)
+ throws SqlCompilationException {
+ return compileToPinotQuery(sql, true);
+ }
+
public static PinotQuery compileToPinotQuery(String sql)
throws SqlCompilationException {
- // Remove the comments from the query
- sql = removeComments(sql);
Review comment:
This is from conflict resolution. Fixed.
##########
File path:
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
##########
@@ -117,21 +117,50 @@ private static String removeTerminatingSemicolon(String
sql) {
return sql;
}
+ private static SqlNode parse(String sql) {
+ SqlParser sqlParser = SqlParser.create(sql, PARSER_CONFIG);
+ try {
+ return sqlParser.parseQuery();
+ } catch (SqlParseException e) {
+ throw new SqlCompilationException("Caught exception while parsing query:
" + sql, e);
+ }
+ }
+
+ public static PinotQuery compileToPinotQueryWithSubquery(String sql)
+ throws SqlCompilationException {
+ return compileToPinotQuery(sql, true);
+ }
+
public static PinotQuery compileToPinotQuery(String sql)
throws SqlCompilationException {
- // Remove the comments from the query
- sql = removeComments(sql);
+ return compileToPinotQuery(sql, false);
Review comment:
Done
--
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]