public String toSQLString() {
    StringBuilder sqlBuilder = new StringBuilder();
    sqlBuilder.append("SELECT").append(' ');
    if (hasLast()) {
      sqlBuilder.append("LAST").append(' ');
    }
    for (int i = 0; i < resultColumns.size(); i++) {
      ResultColumn resultColumn = resultColumns.get(i);
      sqlBuilder.append(resultColumn.getExpression().getExpressionString());
      if (resultColumn.hasAlias()) {
        sqlBuilder.append('(').append(resultColumn.getAlias()).append(')');
      }
      if (i < resultColumns.size() - 1) {
        sqlBuilder.append(", ");
      }
    }
    return sqlBuilder.toString();
  }
This class maintains information of {@code SELECT} clause.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/component/SelectComponent.java