@Override
    public PlanNode visitPlan(PlanNode node, Context context) {
      PlanNode newNode = node.clone();
      for (PlanNode child : node.getChildren()) {
        newNode.addChild(child.accept(this, context));
      }
      return newNode;
    }
This rule is used to determine whether the GroupNode can be executed parallel.

<p>Optimization phase: Logical plan planning.

<p>

<ul>
  The GroupNode can be paralleled if the lasted offspring that guarantees the data is grouped by
  PartitionKey or is sorted by PartitionKey. For example:
  <ul>
    <li>GroupNode[PK={device_id}, OK={time}] -> ... -> TableDeviceScanNode
    <li>GroupNode[PK={device_id}, OK={s1}] -> ... -> TableDeviceScanNode
    <li>GroupNode[PK={device_id,attr}, OK={time}] -> ... -> TableDeviceScanNode
    <li>GroupNode[PK={tag1,tag2}, OK={tag3}] -> SortNode[sort={tag1,tag2,tag3}]
    <li>GroupNode[PK={tag1,tag2}, OK={s1}] -> TopKNode[sort={tag1,tag2,tag3}]
    <li>GroupNode[PK={tag1,tag2}, OK={}] -> AggregationNode[group={tag1,tag2}]
    <li>GroupNode[PK={tag1,tag2}, OK={s1}] -> AggregationNode[group={tag1,tag2,s1}]
    <li>GroupNode[PK={tag1}, OK={}] -> TableFunctionNode[partition={tag1,tag2}]
  </ul>
</ul>

<p>Otherwise, the GroupNode should be transformed into a SortNode.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/ParallelizeGrouping.java