yashmayya commented on code in PR #15703:
URL: https://github.com/apache/pinot/pull/15703#discussion_r2074716127


##########
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:
   Ah okay, I didn't realize that the data schema is also being modified. Makes 
sense, thanks for the explanation. 



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to