private List<Pair<Expression, String>> analyzeGroupByLevelSelect(
      Analysis analysis,
      QueryStatement queryStatement,
      ISchemaTree schemaTree,
      GroupByLevelHelper groupByLevelHelper,
      MPPQueryContext queryContext) {
    Map<Integer, Set<Pair<Expression, String>>> outputExpressionMap = new HashMap<>();
    int columnIndex = 0;

    for (ResultColumn resultColumn : queryStatement.getSelectComponent().getResultColumns()) {
      Set<Pair<Expression, String>> outputExpressionSet = new LinkedHashSet<>();

      List<Expression> resultExpressions =
          bindSchemaForExpression(resultColumn.getExpression(), schemaTree, queryContext);
      boolean isCountStar =
          resultColumn.getExpression().getExpressionType().equals(ExpressionType.FUNCTION)
              && ((FunctionExpression) resultColumn.getExpression()).isCountStar();

      for (Expression resultExpression : resultExpressions) {
        Expression outputExpression =
            groupByLevelHelper.applyLevels(
                isCountStar, resultExpression, resultColumn.getAlias(), analysis);
        Expression normalizedOutputExpression = normalizeExpression(outputExpression);
        analyzeExpressionType(analysis, normalizedOutputExpression);
        outputExpressionSet.add(
            new Pair<>(
                normalizedOutputExpression,
                analyzeAlias(
                    groupByLevelHelper.getAlias(outputExpression.getExpressionString()),
                    outputExpression,
                    normalizedOutputExpression,
                    queryStatement)));
      }

      outputExpressionMap.put(columnIndex++, outputExpressionSet);
    }

    // construct output expressions
    ColumnPaginationController paginationController =
        new ColumnPaginationController(
            queryStatement.getSeriesLimit(), queryStatement.getSeriesOffset());
    List<Pair<Expression, String>> outputExpressions = new ArrayList<>();

    for (Set<Pair<Expression, String>> outputExpressionSet : outputExpressionMap.values()) {
      for (Pair<Expression, String> outputExpression : outputExpressionSet) {
        if (paginationController.hasCurOffset()) {
          paginationController.consumeOffset();
        } else if (paginationController.hasCurLimit()) {
          outputExpressions.add(outputExpression);
          groupByLevelHelper.updateGroupByLevelExpressions(outputExpression.left);
          paginationController.consumeLimit();
        } else {
          break;
        }
      }
    }
    return new ArrayList<>(outputExpressions);
  }
process select component for align by time + group by level.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java