siddharthteotia commented on a change in pull request #8412:
URL: https://github.com/apache/pinot/pull/8412#discussion_r837200855



##########
File path: 
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/DistributedQueryPlan.java
##########
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.query.runtime.plan;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.pinot.core.transport.ServerInstance;
+import org.apache.pinot.query.planner.StageMetadata;
+import org.apache.pinot.query.planner.nodes.StageNode;
+
+
+/**
+ * WorkerQueryRequest is the extended version of the {@link 
org.apache.pinot.core.query.request.ServerQueryRequest}.
+ */
+public class DistributedQueryPlan implements Serializable {
+  private final String _stageId;
+  private ServerInstance _serverInstance;
+  private StageNode _stageRoot;
+  private Map<String, StageMetadata> _metadataMap;

Review comment:
       I think we need to revisit this abstraction. It looks very confusing here
   
   Multi-stage `QueryPlan` built at broker comprises of multiple stages. Since 
each StageNode will be executed on some node, that information must already be 
available at the time of building the QueryPlan.
   
   So, then why should the information about `serverInstance` be tracked 
separately ? In fact, we are tracking it in both StageMetadata and then again 
outside here in the deserialized plan.
   
   The StageNode should be self-contained ideally
   
   - root or leaf stage
   - stageId
   - operator tree
   - executor assignment
   
   May be it's ok to track the assignment inside metadata but not sure why we 
need list of instances since a given stage will be executed exactly once
   
   ```
   // used for assigning server/worker nodes.
     private List<ServerInstance> _serverInstances;
   ```
   
   Let's discuss this briefly please




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