private List<Symbol> getMatchedPrefixSymbols(
        GroupContext context, OrderingScheme orderingScheme) {
      Set<Symbol> expectedGroupingKeys = context.groupingKeys;
      List<Symbol> orderKeys = orderingScheme.getOrderBy();
      for (int i = 0; i < orderKeys.size(); i++) {
        if (!expectedGroupingKeys.contains(orderKeys.get(i))) {
          return orderKeys.subList(0, i);
        }
      }
      return 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