abhishekrb19 commented on code in PR #19069:
URL: https://github.com/apache/druid/pull/19069#discussion_r2885235231


##########
web-console/src/utils/druid-query.ts:
##########
@@ -341,7 +363,18 @@ export async function queryDruidSql<T = any>(
 ): Promise<T[]> {
   let sqlResultResp: AxiosResponse;
   try {
-    sqlResultResp = await Api.instance.post('/druid/v2/sql', sqlQueryPayload, 
{ signal });
+    // Inject brokerService into context if configured
+    const payload = consoleBrokerService
+      ? {
+          ...sqlQueryPayload,
+          context: {
+            ...sqlQueryPayload.context,
+            brokerService: consoleBrokerService,
+          },
+        }
+      : sqlQueryPayload;
+
+    sqlResultResp = await Api.instance.post('/druid/v2/sql', payload, { signal 
});

Review Comment:
   Ah I see, thanks for clarifying. I got tripped up by the name 
`consoleBrokerService` - I assumed all queries originating from the console 
would use this, but it sounds like only the console-generated system queries 
would use it.
   
   What do you think about renaming this to something less ambiguous, like 
`consoleSystemQueryBrokerService`? Alternatively, we could leave the name as-is 
if we expect the scope to expand in the future and instead clarify it in the 
tooltip and 
[documentation](https://druid.apache.org/docs/latest/configuration/#query-configuration)
 along with the limitation that @abhishek-chouhan mentioned with watch tiers 
(this can be done separately in a follow up PR)



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