public Ordering getDeviceOrder() {
    checkState(deviceOrderPriority != -1, "The device order is not specified.");
    return sortItemList.get(deviceOrderPriority).getOrdering();
  }
The order of query result set
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/component/OrderByComponent.java