private List<PlanNode> splitRegionScanNodeByRegion(
      RegionScanNode node, DistributionPlanContext context) {
    Map<TRegionReplicaSet, RegionScanNode> regionScanNodeMap = new HashMap<>();
    Set<PartialPath> devicesList = node.getDevicePaths();
    boolean isAllDeviceOnlyInOneRegion = true;

    for (PartialPath device : devicesList) {
      List<TRegionReplicaSet> dataDistribution =
          analysis.getPartitionInfoByDevice(device, context.getPartitionTimeFilter());
      isAllDeviceOnlyInOneRegion = isAllDeviceOnlyInOneRegion && dataDistribution.size() == 1;
      for (TRegionReplicaSet dataRegion : dataDistribution) {
        regionScanNodeMap
            .computeIfAbsent(
                dataRegion,
                k -> {
                  RegionScanNode regionScanNode = (RegionScanNode) node.clone();
                  regionScanNode.setPlanNodeId(context.queryContext.getQueryId().genPlanNodeId());
                  regionScanNode.setRegionReplicaSet(dataRegion);
                  regionScanNode.setOutputCount(node.isOutputCount());
                  regionScanNode.clearPath();
                  return regionScanNode;
                })
            .addDevicePath(device, node);
      }
    }

    context.setOneSeriesInMultiRegion(!isAllDeviceOnlyInOneRegion);
    // If there is only one region, return directly
    return new ArrayList<>(regionScanNodeMap.values());
  }
aggregation align by device, and aggregation is `count_if` or `diff`, or aggregation used with
group by parameter (session, variation, count), use the old aggregation logic
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SourceRewriter.java