@Override
  public Pattern<CorrelatedJoinNode> getPattern() {
    return PATTERN;
  }
This rule decorrelates a correlated subquery with: - single global aggregation, or - global
aggregation over distinct operator (grouped aggregation with no aggregation assignments), in case
when the distinct operator cannot be de-correlated by PlanNodeDecorrelator It is similar to
TransformCorrelatedGlobalAggregationWithProjection rule, but does not support projection over
aggregation in the subquery

<p>In the case of single aggregation, it transforms:

<pre>
- CorrelatedJoin LEFT or INNER (correlation: [c], filter: true, output: a, count, agg)
     - Input (a, c)
     - Aggregation global
       count <- count(*)
       agg <- agg(b)
          - Source (b) with correlated filter (b > c)
</pre>

Into:

<pre>
- Project (a <- a, count <- count, agg <- agg)
     - Aggregation (group by [a, c, unique])
       count <- count(*) mask(non_null)
       agg <- agg(b) mask(non_null)
          - LEFT join (filter: b > c)
               - UniqueId (unique)
                    - Input (a, c)
               - Project (non_null <- TRUE)
                    - Source (b) decorrelated
</pre>

<p>In the case of global aggregation over distinct operator, it transforms:

<pre>
- CorrelatedJoin LEFT or INNER (correlation: [c], filter: true, output: a, count, agg)
     - Input (a, c)
     - Aggregation global
       count <- count(*)
       agg <- agg(b)
          - Aggregation "distinct operator" group by [b]
               - Source (b) with correlated filter (b > c)
</pre>

Into:

<pre>
- Project (a <- a, count <- count, agg <- agg)
     - Aggregation (group by [a, c, unique])
       count <- count(*) mask(non_null)
       agg <- agg(b) mask(non_null)
          - Aggregation "distinct operator" group by [a, c, unique, non_null, b]
               - LEFT join (filter: b > c)
                    - UniqueId (unique)
                         - Input (a, c)
                    - Project (non_null <- TRUE)
                         - Source (b) decorrelated
</pre>
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/iterative/rule/TransformCorrelatedGlobalAggregationWithoutProjection.java