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 2020/03/02 07:17:14 UTC

[GitHub] [incubator-iotdb] liutaohua commented on a change in pull request #864: [IOTDB-527] Refactor series reader

liutaohua commented on a change in pull request #864: [IOTDB-527] Refactor series reader
URL: https://github.com/apache/incubator-iotdb/pull/864#discussion_r386227373
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
 ##########
 @@ -64,45 +67,33 @@ public GroupByWithoutValueFilterDataSet(QueryContext context, GroupByPlan groupB
       throws StorageEngineException {
     super(context, groupByPlan);
 
-    this.pathToAggrIndexesMap = new HashMap<>();
-    this.aggregateReaders = new HashMap<>();
-    this.cachedBatchDataList = new ArrayList<>();
-    for (int i = 0; i < paths.size(); i++) {
-      cachedBatchDataList.add(null);
-    }
     initGroupBy(context, groupByPlan);
   }
 
-  /**
-   * init reader and aggregate function.
-   */
   private void initGroupBy(QueryContext context, GroupByPlan groupByPlan)
       throws StorageEngineException {
     IExpression expression = groupByPlan.getExpression();
-    this.groupByPlan = groupByPlan;
 
     Filter timeFilter = null;
-    // init reader
     if (expression != null) {
       timeFilter = ((GlobalTimeExpression) expression).getFilter();
     }
 
     for (int i = 0; i < paths.size(); i++) {
       Path path = paths.get(i);
-      List<Integer> indexList = pathToAggrIndexesMap
-          .computeIfAbsent(path, key -> new ArrayList<>());
-      indexList.add(i);
-      if (!aggregateReaders.containsKey(path)) {
-
-        QueryDataSource queryDataSource = QueryResourceManager.getInstance()
-            .getQueryDataSource(path, context, timeFilter);
-        // update filter by TTL
-        timeFilter = queryDataSource.updateFilterUsingTTL(timeFilter);
-
-        IAggregateReader seriesReader = new SeriesAggregateReader(path, dataTypes.get(i), context,
-            queryDataSource, timeFilter, null, null);
-        aggregateReaders.put(path, seriesReader);
-      }
+
+      QueryDataSource queryDataSource = QueryResourceManager.getInstance()
+          .getQueryDataSource(path, context, timeFilter);
+      // update filter by TTL
+      timeFilter = queryDataSource.updateFilterUsingTTL(timeFilter);
 
 Review comment:
   done

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


With regards,
Apache Git Services