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

 ##########
 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:
   Current approach is to route SQL query from ui still to PQL endpoint, but 
with query options `groupByMode=sql;responseFormat=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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to