@Override
    public List<Symbol> visitDeviceTableScan(DeviceTableScanNode node, GroupContext context) {
      Set<Symbol> expectedGroupingKeys = context.groupingKeys;
      Map<Symbol, ColumnSchema> assignments = node.getAssignments();
      return expectedGroupingKeys.stream()
          .filter(
              k -> {
                ColumnSchema columnSchema = assignments.get(k);
                if (columnSchema != null) {
                  return columnSchema.getColumnCategory() == TAG
                      || columnSchema.getColumnCategory() == ATTRIBUTE;
                }
                return false;
              })
          .collect(Collectors.toList());
    }
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