xiangfu0 commented on code in PR #8557:
URL: https://github.com/apache/pinot/pull/8557#discussion_r853314724


##########
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotClientRequest.java:
##########
@@ -197,6 +206,29 @@ public void processSqlQueryPost(String query, @Suspended 
AsyncResponse asyncResp
     }
   }
 
+  private BrokerResponse executeSqlQuery(ObjectNode sqlRequestJson, 
HttpRequesterIdentity httpRequesterIdentity)
+      throws Exception {
+    SqlNodeAndOptions sqlNodeAndOptions;
+    try {
+      sqlNodeAndOptions = 
CalciteSqlParser.compileToSqlNodeAndOptions(sqlRequestJson.get(Request.SQL).asText());
+    } catch (Exception e) {
+      return new 
BrokerResponseNative(QueryException.getException(QueryException.PQL_PARSING_ERROR,
 e));
+    }
+    PinotSqlType sqlType = 
CalciteSqlParser.extractSqlType(sqlNodeAndOptions.getSqlNode());
+    switch (sqlType) {
+      case DQL:
+        return _requestHandler.handleRequest(sqlRequestJson, 
httpRequesterIdentity, new RequestStatistics());

Review Comment:
   yes. If we want to reuse the SqlNode, it requires refactoring to add it into 
requestHandler's interface, which I don't want to change  for now.



-- 
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...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to