public static AggregationNode restoreDistinctAggregation(
      AggregationNode distinct, PlanNode source, List<Symbol> groupingKeys) {
    checkArgument(isDistinctOperator(distinct));
    return new AggregationNode(
        distinct.getPlanNodeId(),
        source,
        ImmutableMap.of(),
        AggregationNode.singleGroupingSet(groupingKeys),
        ImmutableList.of(),
        distinct.getStep(),
        Optional.empty(),
        Optional.empty());
  }
Creates distinct aggregation node based on existing distinct aggregation node.

@see #isDistinctOperator(PlanNode)
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/iterative/rule/AggregationDecorrelation.java