public String toSQLString(boolean hasGroupByTime) {
    StringBuilder sqlBuilder = new StringBuilder();
    if (hasGroupByTime) {
      sqlBuilder.append(", ");
    } else {
      sqlBuilder.append("GROUP BY ");
    }
    sqlBuilder.append("LEVEL = ");
    for (int i = 0; i < levels.length; i++) {
      sqlBuilder.append(levels[i]);
      if (i < levels.length - 1) {
        sqlBuilder.append(',').append(' ');
      }
    }
    return sqlBuilder.toString();
  }
This class maintains information of {@code GROUP BY LEVEL} clause.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/component/GroupByLevelComponent.java