@Override
  public Operator visitTimeSeriesRegionScan(
      TimeseriesRegionScanNode node, LocalExecutionPlanContext context) {
    OperatorContext operatorContext =
        context
            .getDriverContext()
            .addOperatorContext(
                context.getNextOperatorId(),
                node.getPlanNodeId(),
                ActiveTimeSeriesRegionScanOperator.class.getSimpleName());
    Filter filter = context.getGlobalTimeFilter();
    DataDriverContext dataDriverContext = (DataDriverContext) context.getDriverContext();

    Map<IDeviceID, Map<String, TimeseriesContext>> timeseriesToSchemaInfo = new HashMap<>();
    Map<IDeviceID, Long> ttlCache = new HashMap<>();
    for (Map.Entry<PartialPath, Map<PartialPath, List<TimeseriesContext>>> entryMap :
        node.getDeviceToTimeseriesSchemaInfo().entrySet()) {
      PartialPath devicePath = entryMap.getKey();
      IDeviceID deviceID = devicePath.getIDeviceID();
      Map<String, TimeseriesContext> timeseriesSchemaInfoMap =
          getTimeseriesSchemaInfoMap(entryMap, dataDriverContext);
      timeseriesToSchemaInfo.put(deviceID, timeseriesSchemaInfoMap);
      ttlCache.put(deviceID, DataNodeTTLCache.getInstance().getTTLForTree(deviceID));
    }
    ActiveTimeSeriesRegionScanOperator regionScanOperator =
        new ActiveTimeSeriesRegionScanOperator(
            operatorContext,
            node.getPlanNodeId(),
            timeseriesToSchemaInfo,
            filter,
            ttlCache,
            node.isOutputCount());

    dataDriverContext.addSourceOperator(regionScanOperator);
    dataDriverContext.setQueryDataSourceType(QueryDataSourceType.TIME_SERIES_REGION_SCAN);

    return regionScanOperator;
  }
Now, we allocate children to each pipeline as average as possible. For example, 5 children with
3 dop, the children group will be [1, 2, 2]. After we can estimate the workload of each
operator, maybe we can allocate based on workload rather than child number.

<p>If child is ExchangeNode, it won't affect the children number of current group.

<p>This method can only be invoked when dop <= localChildrenSize.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/OperatorTreeGenerator.java