@Override
    public List<Symbol> visitPlan(PlanNode node, GroupContext context) {
      List<List<Symbol>> result =
          node.getChildren().stream()
              .map(child -> child.accept(new DeriveGroupProperties(), context))
              .distinct()
              .collect(Collectors.toList());
      return result.size() == 1 ? result.get(0) : ImmutableList.of();
    }
This visitor returns the list of preGroupedSymbols of current AggregationNode. Attention: The
preGroupedSymbols of child-AggregationNode should have been calculated. GroupContext: The
GroupingKeys of current AggregationNode.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/TransformAggregationToStreamable.java