kfaraz commented on code in PR #17846:
URL: https://github.com/apache/druid/pull/17846#discussion_r2024274925


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/SegmentLoadStatusFetcher.java:
##########
@@ -238,22 +238,28 @@ private void updateStatus(State state, DateTime startTime)
    */
   private VersionLoadStatus fetchLoadStatusFromBroker() throws Exception
   {
-    Request request = brokerClient.makeRequest(HttpMethod.POST, 
"/druid/v2/sql/");
-    SqlQuery sqlQuery = new SqlQuery(StringUtils.format(LOAD_QUERY, 
datasource, versionsConditionString),
-                                     ResultFormat.OBJECTLINES,
+    ClientSqlQuery clientSqlQuery = new 
ClientSqlQuery(StringUtils.format(LOAD_QUERY, datasource, 
versionsConditionString),
+                                     ResultFormat.OBJECTLINES.contentType(),
                                      false, false, false, null, null
     );
-    request.setContent(MediaType.APPLICATION_JSON, 
objectMapper.writeValueAsBytes(sqlQuery));
-    String response = brokerClient.sendQuery(request);
+    ListenableFuture<SqlTaskStatus> response = 
brokerClient.submitSqlTask(clientSqlQuery);

Review Comment:
   This use case doesn't warrant a sql task, just a plain SQL query using the 
endpoint `/druid/v2/sql`.
   The `/druid/v2/sql/task` endpoint is for launching MSQ tasks (controller + 
worker).
   
   The correct approach here would be to add a new method to `BrokerClient` and 
`BrokerClientImpl` which hits the `/druid/v2/sql` endpoint and use that here.



-- 
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]

Reply via email to