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 2021/02/23 07:56:29 UTC

[GitHub] [iotdb] wshao08 commented on a change in pull request #2714: [IOTDB-1024] Support multiple aggregated measurements for group by level statement

wshao08 commented on a change in pull request #2714:
URL: https://github.com/apache/iotdb/pull/2714#discussion_r580828177



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
##########
@@ -876,6 +877,16 @@ private void deduplicate(QueryPlan queryPlan, int fetchSize)
                   .getContext()
                   .getColumnName()
               : columnForReader;
+      if (queryPlan instanceof AggregationPlan && ((AggregationPlan) queryPlan).getLevel() >= 0) {
+        String aggregatePath =
+            originalPath.isMeasurementAliasExists()
+                ? FilePathUtils.generatePartialPathByLevel(
+                    originalPath.getFullPathWithAlias(), ((AggregationPlan) queryPlan).getLevel())
+                : FilePathUtils.generatePartialPathByLevel(
+                    originalPath.toString(), ((AggregationPlan) queryPlan).getLevel());

Review comment:
       The modified value of `columnForReader` is used between line 858-871. Considering the complexity of `deduplicate()`, I tried not to make much changes here to keep correctness. 
   Perhaps refactor `deduplicate()` and moving it into QueryPlan would be a choice. What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org