@Override
  public Operator visitAlignedSeriesAggregationScan(
      AlignedSeriesAggregationScanNode node, LocalExecutionPlanContext context) {

    if (context.isBuildPlanUseTemplate()) {
      Ordering scanOrder = context.getTemplatedInfo().getScanOrder();
      List<AggregationDescriptor> aggregationDescriptors;
      if (node.getDescriptorType() == 0 || node.getDescriptorType() == 2) {
        aggregationDescriptors = context.getTemplatedInfo().getAscendingDescriptorList();
      } else {
        scanOrder = scanOrder.reverse();
        aggregationDescriptors = context.getTemplatedInfo().getDescendingDescriptorList();
      }

      return constructAlignedSeriesAggregationScanOperator(
          node.getPlanNodeId(),
          node.getAlignedPath(),
          aggregationDescriptors,
          context.getTemplatedInfo().getPushDownPredicate(),
          scanOrder,
          context.getTemplatedInfo().getGroupByTimeParameter(),
          context.getTemplatedInfo().isOutputEndTime(),
          context);
    }

    return constructAlignedSeriesAggregationScanOperator(
        node.getPlanNodeId(),
        node.getAlignedPath(),
        node.getAggregationDescriptorList(),
        node.getPushDownPredicate(),
        node.getScanOrder(),
        node.getGroupByTimeParameter(),
        node.isOutputEndTime(),
        context);
  }
This Visitor is responsible for transferring PlanNode Tree to Operator Tree.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java