protected void calcFromStatistics(Statistics timeStatistics, Statistics[] valueStatistics) {
    int idx = -1;

    for (TableAggregator aggregator : tableAggregators) {
      if (aggregator.hasFinalResult()) {
        idx += aggregator.getChannelCount();
        continue;
      }

      Statistics[] statisticsArray = new Statistics[aggregator.getChannelCount()];
      for (int i = 0; i < aggregator.getChannelCount(); i++) {
        idx++;

        TsTableColumnCategory columnSchemaCategory =
            aggColumnSchemas.get(aggregatorInputChannels.get(idx)).getColumnCategory();
        statisticsArray[i] =
            buildStatistics(
                columnSchemaCategory,
                timeStatistics,
                valueStatistics,
                aggregatorInputChannels.get(idx));
      }

      aggregator.processStatistics(statisticsArray);
    }
  }
Calculate aggregation value on the time range from the tsBlock containing raw data.

@return left - whether the aggregation calculation of the current time range has done; right -
    remaining tsBlock
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/AbstractAggTableScanOperator.java