You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/03/16 03:25:03 UTC
[GitHub] [iotdb] qiaojialin commented on a change in pull request #5250: [IOTDB-2725] MPP query engine interface definition
qiaojialin commented on a change in pull request #5250:
URL: https://github.com/apache/iotdb/pull/5250#discussion_r827589304
##########
File path: server/src/main/java/org/apache/iotdb/db/mpp/plan/node/process/WithoutNode.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.iotdb.db.mpp.plan.node.process;
+
+import org.apache.iotdb.db.mpp.common.WithoutPolicy;
+import org.apache.iotdb.db.mpp.plan.node.PlanNodeId;
+
+/** WithoutNode is used to discard specific rows from upstream node. */
+public class WithoutNode extends ProcessNode {
Review comment:
```suggestion
public class FilterNullNode extends ProcessNode {
```
##########
File path: server/src/main/java/org/apache/iotdb/db/mpp/execution/QueryExecution.java
##########
@@ -0,0 +1,96 @@
+/*
+ * 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.iotdb.db.mpp.execution;
+
+import org.apache.iotdb.db.mpp.common.Analysis;
+import org.apache.iotdb.db.mpp.common.QueryContext;
+import org.apache.iotdb.db.mpp.plan.*;
+import org.apache.iotdb.db.mpp.plan.optimzation.PlanOptimizer;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+
+/**
+ * QueryExecution stores all the status of a query which is being prepared or running inside the MPP
+ * frame. It takes three main responsibilities: 1. Prepare a query. Transform a query from statement
+ * to DistributedQueryPlan with fragment instances. 2. Dispatch all the fragment instances to
+ * corresponding physical nodes. 3. Collect and monitor the progress/states of this query.
+ */
+public class QueryExecution {
+ private QueryContext context;
+ private QueryScheduler scheduler;
+ private QueryStateMachine stateMachine;
Review comment:
Use the stateMachine in QueryScheduler?
##########
File path: server/src/main/java/org/apache/iotdb/db/mpp/execution/QueryExecution.java
##########
@@ -0,0 +1,96 @@
+/*
+ * 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.iotdb.db.mpp.execution;
+
+import org.apache.iotdb.db.mpp.common.Analysis;
+import org.apache.iotdb.db.mpp.common.QueryContext;
+import org.apache.iotdb.db.mpp.plan.*;
+import org.apache.iotdb.db.mpp.plan.optimzation.PlanOptimizer;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+
+/**
+ * QueryExecution stores all the status of a query which is being prepared or running inside the MPP
+ * frame. It takes three main responsibilities: 1. Prepare a query. Transform a query from statement
+ * to DistributedQueryPlan with fragment instances. 2. Dispatch all the fragment instances to
+ * corresponding physical nodes. 3. Collect and monitor the progress/states of this query.
+ */
+public class QueryExecution {
+ private QueryContext context;
+ private QueryScheduler scheduler;
+ private QueryStateMachine stateMachine;
+
+ private List<PlanOptimizer> planOptimizers;
+
+ private Analysis analysis;
+ private LogicalQueryPlan logicalPlan;
+ private DistributedQueryPlan distributedPlan;
+ private List<PlanFragment> fragments;
+ private List<FragmentInstance> fragmentInstances;
+
+ public QueryExecution(QueryContext context) {
+ this.context = context;
+ }
+
+ public void plan() {
+ analyze();
+ doLogicalPlan();
+ doDistributedPlan();
+ planFragmentInstances();
+ }
+
+ public void schedule() {
+ this.scheduler = new QueryScheduler(this.stateMachine, this.fragmentInstances);
+ this.scheduler.start();
+ }
+
+ // Analyze the statement in QueryContext. Generate the analysis this query need
+ public void analyze() {
+ // initialize the variable `analysis`
+
+ }
+
+ // Use LogicalPlanner to do the logical query plan and logical optimization
+ public void doLogicalPlan() {
+ LogicalPlanner planner = new LogicalPlanner(this.analysis, this.context, this.planOptimizers);
+ this.logicalPlan = planner.plan();
+ }
+
+ // Generate the distributed plan and split it into fragments
+ public void doDistributedPlan() {
Review comment:
```suggestion
public void generateDistributedPlan() {
```
##########
File path: server/src/main/java/org/apache/iotdb/db/mpp/execution/QueryExecution.java
##########
@@ -0,0 +1,96 @@
+/*
+ * 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.iotdb.db.mpp.execution;
+
+import org.apache.iotdb.db.mpp.common.Analysis;
+import org.apache.iotdb.db.mpp.common.QueryContext;
+import org.apache.iotdb.db.mpp.plan.*;
+import org.apache.iotdb.db.mpp.plan.optimzation.PlanOptimizer;
+
+import java.nio.ByteBuffer;
+import java.util.List;
+
+/**
+ * QueryExecution stores all the status of a query which is being prepared or running inside the MPP
+ * frame. It takes three main responsibilities: 1. Prepare a query. Transform a query from statement
+ * to DistributedQueryPlan with fragment instances. 2. Dispatch all the fragment instances to
+ * corresponding physical nodes. 3. Collect and monitor the progress/states of this query.
+ */
+public class QueryExecution {
+ private QueryContext context;
+ private QueryScheduler scheduler;
+ private QueryStateMachine stateMachine;
+
+ private List<PlanOptimizer> planOptimizers;
+
+ private Analysis analysis;
+ private LogicalQueryPlan logicalPlan;
+ private DistributedQueryPlan distributedPlan;
+ private List<PlanFragment> fragments;
+ private List<FragmentInstance> fragmentInstances;
+
+ public QueryExecution(QueryContext context) {
+ this.context = context;
+ }
+
+ public void plan() {
+ analyze();
+ doLogicalPlan();
+ doDistributedPlan();
+ planFragmentInstances();
+ }
+
+ public void schedule() {
+ this.scheduler = new QueryScheduler(this.stateMachine, this.fragmentInstances);
+ this.scheduler.start();
+ }
+
+ // Analyze the statement in QueryContext. Generate the analysis this query need
+ public void analyze() {
+ // initialize the variable `analysis`
+
+ }
+
+ // Use LogicalPlanner to do the logical query plan and logical optimization
+ public void doLogicalPlan() {
Review comment:
```suggestion
public void generateLogicalPlan() {
```
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org