Alima777 commented on a change in pull request #796: [IoTDB-468] Restructure 
QueryPlan
URL: https://github.com/apache/incubator-iotdb/pull/796#discussion_r378157032
 
 

 ##########
 File path: 
server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
 ##########
 @@ -242,16 +244,26 @@ private PhysicalPlan transformQuery(QueryOperator 
queryOperator)
       ((AggregationPlan) queryPlan)
           
.setAggregations(queryOperator.getSelectOperator().getAggregations());
     } else {
-      queryPlan = new QueryPlan();
+      queryPlan = new RawDataQueryPlan();
     }
     if (queryOperator.isGroupByDevice()) {
-      // below is the core realization of GROUP_BY_DEVICE sql logic
+      // below is the core realization of ALIGN_BY_DEVICE sql logic
+      AlignByDevicePlan alignByDevicePlan = new AlignByDevicePlan();
+      if (queryPlan instanceof GroupByPlan) {
+        alignByDevicePlan.setGroupByPlan((GroupByPlan) queryPlan);
+      } else if (queryPlan instanceof FillQueryPlan) {
+        alignByDevicePlan.setFillQueryPlan((FillQueryPlan) queryPlan);
+      } else if (queryPlan instanceof AggregationPlan) {
+        alignByDevicePlan.setAggregationPlan((AggregationPlan) queryPlan);
+      }
+
+      queryPlan = alignByDevicePlan;
 
 Review comment:
   Thank you for advice! Fixed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to