private <T extends Expression> Collection<Cluster<T>> cluster(Scope scope, List<T> expressions) {
    Map<ScopeAware<T>, List<T>> sets = new LinkedHashMap<>();

    for (T expression : expressions) {
      sets.computeIfAbsent(scopeAwareKey(expression, analysis, scope), key -> new ArrayList<>())
          .add(expression);
    }

    return sets.values().stream()
        .map(cluster -> Cluster.newCluster(cluster, scope, analysis))
        .collect(toImmutableList());
  }
Group expressions into clusters such that all entries in a cluster are #equals to each other
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/SubqueryPlanner.java