npawar commented on a change in pull request #4994: Make sql as default query 
format.
URL: https://github.com/apache/incubator-pinot/pull/4994#discussion_r369124947
 
 

 ##########
 File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java
 ##########
 @@ -143,9 +172,20 @@ public String getQueryResponse(String pqlQuery, String 
traceEnabled, String quer
     }
     String hostNameWithPrefix = instanceConfig.getHostName();
     String url =
-        "http://"; + 
hostNameWithPrefix.substring(hostNameWithPrefix.indexOf("_") + 1) + ":" + 
instanceConfig.getPort()
-            + "/query";
-    return sendPQLRaw(url, pqlQuery, traceEnabled, queryOptions);
+        
getQueryURL(hostNameWithPrefix.substring(hostNameWithPrefix.indexOf("_") + 1), 
instanceConfig.getPort(),
+            querySyntax);
+    return sendQueryRaw(url, query, traceEnabled);
+  }
+
+  private String getQueryURL(String hostName, String port, String querySyntax) 
{
+    switch (querySyntax) {
+      case CommonConstants.Broker.Request.SQL:
+        return String.format("http://%s:%s/query/sql";, hostName, port);
 
 Review comment:
   The `/query/sql` endpoint is full sql - SQL parser, sql execution and sql 
response format. I thought you are intending to have
   `/pql` - full pql endpoint
   `/sql` - sql execution, sql response, but pql parser. 
   In that case, we would need a query option in the `/query/sql` endpoint to 
switch between pql/sql parser.
   And essentially, we are ending up with 3 modes, 
   1. full pql - `/pql` endpoint
   2. partial sql with pql parser - default `/sql` endpoint
   3. full sql - `/sql` endpoint, with query param

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to