@Override
  protected void updateResultTsBlock() {
    appendAggregationResult();

    if (timeIterator.hasCachedTimeRange()) {
      updateLastCacheIfPossible();
    }

    outputDeviceIndex++;

    // after appendAggregationResult invoked, aggregators must be cleared
    resetTableAggregators();
  }
Main process logic, calc the last aggregation results of current device.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java