private void analyzeGroupByLevelHaving(
      Analysis analysis,
      QueryStatement queryStatement,
      ISchemaTree schemaTree,
      GroupByLevelHelper groupByLevelHelper,
      MPPQueryContext queryContext) {
    if (!queryStatement.hasHaving()) {
      return;
    }

    analyzeHavingBase(
        analysis,
        queryStatement,
        schemaTree,
        havingExpression ->
            PredicateUtils.removeDuplicateConjunct(
                groupByLevelHelper.applyLevels(havingExpression, analysis)),
        queryContext);
    // update groupByLevelExpressions
    groupByLevelHelper.updateGroupByLevelExpressions(analysis.getHavingExpression());
  }
process select component for align by device.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java