public String toSQLString() {
    StringBuilder sqlBuilder = new StringBuilder();
    sqlBuilder.append("ORDER BY ");
    for (int i = 0; i < sortItemList.size(); i++) {
      sqlBuilder.append(sortItemList.get(i).toSQLString());
      if (i < sortItemList.size() - 1) {
        sqlBuilder.append(", ");
      }
    }
    return sqlBuilder.toString();
  }
The order of query result set
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/component/OrderByComponent.java