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


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/serde/StageNodeDeserializer.java:
##########
@@ -0,0 +1,384 @@
+/**
+ * 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.planner.serde;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelFieldCollation;
+import org.apache.calcite.rel.core.JoinRelType;
+import org.apache.calcite.rel.logical.PinotRelExchangeType;
+import org.apache.pinot.common.proto.Plan;
+import org.apache.pinot.common.utils.DataSchema;
+import org.apache.pinot.query.planner.logical.RexExpression;
+import org.apache.pinot.query.planner.plannode.AbstractPlanNode;
+import org.apache.pinot.query.planner.plannode.AggregateNode;
+import org.apache.pinot.query.planner.plannode.ExchangeNode;
+import org.apache.pinot.query.planner.plannode.FilterNode;
+import org.apache.pinot.query.planner.plannode.JoinNode;
+import org.apache.pinot.query.planner.plannode.MailboxReceiveNode;
+import org.apache.pinot.query.planner.plannode.MailboxSendNode;
+import org.apache.pinot.query.planner.plannode.ProjectNode;
+import org.apache.pinot.query.planner.plannode.SetOpNode;
+import org.apache.pinot.query.planner.plannode.SortNode;
+import org.apache.pinot.query.planner.plannode.TableScanNode;
+import org.apache.pinot.query.planner.plannode.ValueNode;
+import org.apache.pinot.query.planner.plannode.WindowNode;
+
+
+public class StageNodeDeserializer {
+  private StageNodeDeserializer() {
+  }
+
+  public static AbstractPlanNode process(Plan.StageNode protoNode) {
+    switch (protoNode.getNodeTypeCase()) {
+      case TABLESCANNODE:
+        return visitTableScanNode(protoNode);
+      case RECEIVENODE:
+        return visitMailboxReceiveNode(protoNode);
+      case SENDNODE:
+        return visitMailboxSendNode(protoNode);
+      case SETNODE:
+        return visitSetNode(protoNode);
+      case EXCHANGENODE:
+        return visitExchangeNode(protoNode);
+      case SORTNODE:
+        return visitSortNode(protoNode);
+      case WINDOWNODE:
+        return visitWindowNode(protoNode);
+      case VALUENODE:
+        return visitValueNode(protoNode);
+      case PROJECTNODE:
+        return visitProjectNode(protoNode);
+      case FILTERNODE:
+        return visitFilterNode(protoNode);
+      case AGGREGATENODE:
+        return visitAggregateNode(protoNode);
+      case JOINNODE:
+        return visitJoinNode(protoNode);

Review Comment:
   This doesn't really seem to be implementing the visitor pattern so the 
naming feels a little odd here. Maybe `processTableScanNode` or 
`deserializeTableScanNode` might be more appropriate than `visitTableScanNode` 
(and likewise for the other node types), WDYT?



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