@Override
  public List<PlanNode> visitTransform(TransformNode node, DistributionPlanContext context) {
    List<PlanNode> children = rewrite(node.getChild(), context);
    if (children.size() == 1) {
      node.setChild(children.get(0));
      return Collections.singletonList(node);
    }

    // for some query such as `select avg(s1)+avg(s2) from root.** where count(s3)>1 align by
    // device`,
    // the children of TransformNode may be N(N>1) DeviceViewNodes, so need return N TransformNodes
    return children.stream()
        .map(
            child -> {
              TransformNode transformNode = cloneTransformNodeWithOutChild(node, context);
              transformNode.addChild(child);
              return transformNode;
            })
        .collect(Collectors.toList());
  }
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