Problem
The BrokerQueryEventListener SPI only receives RequestContext in onQueryCompletion(RequestContext). Several fields that are fully populated only after query execution — isPartialResult(), getPools(), getRLSFiltersApplied(), getTablesQueried(), isNumGroupsWarningLimitReached() — are only available on BrokerResponse, not on RequestContext.
This makes it impossible for downstream implementations (e.g. async query-log pipelines) to capture the complete query metadata without modifying the SPI.
Proposed Solution
-
Add a protected onQueryCompletion(RequestContext, BrokerResponse) hook to BaseBrokerRequestHandler. The default implementation delegates to the existing SPI listener (no behaviour change). Subclasses can override to intercept the full response.
-
Add a protected createSingleStageBrokerRequestHandler(...) factory method to BaseBrokerStarter so subclasses can inject a custom handler that overrides the hook. Follows the same pattern as the existing createWorkerManager(...) factory.
Problem
The
BrokerQueryEventListenerSPI only receivesRequestContextinonQueryCompletion(RequestContext). Several fields that are fully populated only after query execution —isPartialResult(),getPools(),getRLSFiltersApplied(),getTablesQueried(),isNumGroupsWarningLimitReached()— are only available onBrokerResponse, not onRequestContext.This makes it impossible for downstream implementations (e.g. async query-log pipelines) to capture the complete query metadata without modifying the SPI.
Proposed Solution
Add a
protected onQueryCompletion(RequestContext, BrokerResponse)hook toBaseBrokerRequestHandler. The default implementation delegates to the existing SPI listener (no behaviour change). Subclasses can override to intercept the full response.Add a
protected createSingleStageBrokerRequestHandler(...)factory method toBaseBrokerStarterso subclasses can inject a custom handler that overrides the hook. Follows the same pattern as the existingcreateWorkerManager(...)factory.