protected void appendAggregationResult() {
    // no data in current time range, just output empty
    if (!timeIterator.hasCachedTimeRange()) {
      return;
    }

    appendGroupKeysToResult(deviceEntries, currentDeviceIndex);

    if (dateBinSize > 0) {
      resultTsBlockBuilder.getValueColumnBuilders()[groupingKeySize].writeLong(
          timeIterator.getCurTimeRange().getMin());
    }

    for (int i = 0; i < tableAggregators.size(); i++) {
      tableAggregators
          .get(i)
          .evaluate(
              resultTsBlockBuilder.getValueColumnBuilders()[groupingKeySize + dateBinSize + i]);
    }

    resultTsBlockBuilder.declarePosition();
  }
Append a row of aggregation results to the result tsBlock.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/AbstractAggTableScanOperator.java