You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/21 00:23:57 UTC

[GitHub] [pinot] siddharthteotia commented on a diff in pull request #9439: [multistage] make leaf stage run query optimizer

siddharthteotia commented on code in PR #9439:
URL: https://github.com/apache/pinot/pull/9439#discussion_r975912617


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/utils/ServerRequestUtils.java:
##########
@@ -65,25 +72,37 @@ public class ServerRequestUtils {
       ImmutableList.of(PredicateComparisonRewriter.class.getName());
   private static final List<QueryRewriter> QUERY_REWRITERS = new ArrayList<>(
       QueryRewriterFactory.getQueryRewriters(QUERY_REWRITERS_CLASS_NAMES));
+  private static final QueryOptimizer QUERY_OPTIMIZER = new QueryOptimizer();
 
   private ServerRequestUtils() {
     // do not instantiate.
   }
 
   // TODO: This is a hack, make an actual ServerQueryRequest converter.
   public static List<ServerQueryRequest> constructServerQueryRequest(DistributedStagePlan distributedStagePlan,
-      Map<String, String> requestMetadataMap) {
+      Map<String, String> requestMetadataMap, ZkHelixPropertyStore<ZNRecord> helixPropertyStore) {
     StageMetadata stageMetadata = distributedStagePlan.getMetadataMap().get(distributedStagePlan.getStageId());
+    Preconditions.checkState(stageMetadata.getScannedTables().size() == 1,
+        "Server request for V2 engine should only have 1 scan table per request.");
+    String rawTableName = stageMetadata.getScannedTables().get(0);
     Map<String, List<String>> tableToSegmentListMap = stageMetadata.getServerInstanceToSegmentsMap()
         .get(distributedStagePlan.getServerInstance());
     List<ServerQueryRequest> requests = new ArrayList<>();
     for (Map.Entry<String, List<String>> tableEntry : tableToSegmentListMap.entrySet()) {
       String tableType = tableEntry.getKey();
       if (TableType.OFFLINE.name().equals(tableType)) {
-        requests.add(constructServerQueryRequest(distributedStagePlan, requestMetadataMap,
+        TableConfig tableConfig = ZKMetadataProvider.getTableConfig(helixPropertyStore,

Review Comment:
   Let's add a TODO here to optimize  with https://github.com/apache/pinot/pull/9442



-- 
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-unsubscribe@pinot.apache.org

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


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