siddharthteotia commented on code in PR #9191:
URL: https://github.com/apache/pinot/pull/9191#discussion_r948393596
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java:
##########
@@ -202,24 +208,21 @@ private BrokerResponseNative handleRequest(long
requestId, String query,
throws Exception {
LOGGER.debug("SQL query for request {}: {}", requestId, query);
- // Compile the request
- long compilationStartTimeNs = System.nanoTime();
+ long compilationStartTimeNs;
PinotQuery pinotQuery;
try {
- if (sqlNodeAndOptions != null) {
- // Include parse time when the query is already parsed
- compilationStartTimeNs -= sqlNodeAndOptions.getParseTimeNs();
- } else {
- sqlNodeAndOptions = CalciteSqlParser.compileToSqlNodeAndOptions(query);
- }
+ // Parse the request
+ sqlNodeAndOptions = sqlNodeAndOptions != null ? sqlNodeAndOptions
+ : RequestUtils.parseQuery(requestId, query, request);
+ // Compile the request into PinotQuery
+ compilationStartTimeNs = System.nanoTime();
Review Comment:
I feel this will be incorrect accounting as it will miss out the time taken
to build the sqlNodeAndOptions. Shouldn't we stick to what the current code is
doing ?
```
if (sqlNodeAndOptions != null) {
// Include parse time when the query is already parsed
compilationStartTimeNs -= sqlNodeAndOptions.getParseTimeNs();
}
```
--
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]