@Override
  public List<PlanNode> visitGroup(GroupNode node, PlanContext context) {
    context.setExpectedOrderingScheme(node.getOrderingScheme());
    nodeOrderingMap.put(node.getPlanNodeId(), node.getOrderingScheme());
    context.setPushDownGrouping(true);
    List<PlanNode> result = new ArrayList<>();
    context.setExpectedOrderingScheme(node.getOrderingScheme());
    List<PlanNode> childrenNodes = node.getChild().accept(this, context);
    for (PlanNode child : childrenNodes) {
      if (canSortEliminated(node.getOrderingScheme(), nodeOrderingMap.get(child.getPlanNodeId()))) {
        result.add(child);
      } else {
        GroupNode subGroupNode =
            new GroupNode(
                queryId.genPlanNodeId(),
                child,
                node.getOrderingScheme(),
                node.getPartitionKeyCount());
        result.add(subGroupNode);
        // should not set nodeOrderingMap here
      }
    }
    return result;
  }
This class is used to generate distributed plan for table model.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java