Jackie-Jiang commented on code in PR #15703:
URL: https://github.com/apache/pinot/pull/15703#discussion_r2074196840
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -1024,25 +1024,49 @@ private static String getRoutingPolicy(TableConfig
tableConfig) {
return selectorType != null ? selectorType :
RoutingConfig.DEFAULT_INSTANCE_SELECTOR_TYPE;
}
- private BrokerResponseNative getEmptyBrokerOnlyResponse(PinotQuery
pinotQuery, RequestContext requestContext,
- String tableName, @Nullable RequesterIdentity requesterIdentity, Schema
schema, String query, String database) {
+ private BrokerResponseNative getEmptyBrokerOnlyResponse(PinotQuery
pinotQuery, PinotQuery serverPinotQuery,
+ RequestContext requestContext, String tableName, @Nullable
RequesterIdentity requesterIdentity, Schema schema,
+ String query, String database) {
if (pinotQuery.isExplain()) {
// EXPLAIN PLAN results to show that query is evaluated exclusively by
Broker.
return BrokerResponseNative.BROKER_ONLY_EXPLAIN_PLAN_OUTPUT;
}
// Send empty response since we don't need to evaluate either offline or
realtime request.
- BrokerResponseNative brokerResponse = BrokerResponseNative.empty();
- boolean useMSE = QueryOptionsUtils.isUseMSEToFillEmptySchema(
- pinotQuery.getQueryOptions(), _useMSEToFillEmptyResponseSchema);
- ParserUtils.fillEmptyResponseSchema(useMSE, brokerResponse, _tableCache,
schema, database, query);
+ BrokerResponseNative brokerResponse = new BrokerResponseNative();
+ try {
+ QueryContext serverQueryContext =
QueryContextConverterUtils.getQueryContext(serverPinotQuery);
+ ResultTable resultTable =
EmptyResponseUtils.buildEmptyResultTable(serverQueryContext);
+ brokerResponse.setResultTable(resultTable);
+ if (pinotQuery != serverPinotQuery) {
+ QueryContext queryContext =
QueryContextConverterUtils.getQueryContext(pinotQuery);
+ GapfillUtils.GapfillType gapfillType =
GapfillUtils.getGapfillType(queryContext);
+ if (gapfillType == null) {
+ throw new BadQueryRequestException("Nested query is not supported
without gapfill");
+ }
+ BaseGapfillProcessor gapfillProcessor =
GapfillProcessorFactory.getGapfillProcessor(queryContext, gapfillType);
+ gapfillProcessor.process(brokerResponse);
+ }
Review Comment:
Gap-fill (documented
[here](https://docs.pinot.apache.org/users/user-guide-query/query-syntax/gap-fill-functions))
is executed as a subquery + broker processing. Here I basically mimic the
behavior of server returning empty response (or aggregate results), then use
the gapfill processor to fill the data schema properly.
--
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]