public static boolean isConsistentWithScanOrder(
      TAggregationType aggregationFunction, Ordering scanOrder) {
    boolean ascending = scanOrder == Ordering.ASC;
    switch (aggregationFunction) {
      case MIN_TIME:
      case FIRST_VALUE:
        return ascending;
      case MAX_TIME:
      case LAST_VALUE:
        return !ascending;
      case SUM:
      case MIN_VALUE:
      case MAX_VALUE:
      case EXTREME:
      case COUNT:
      case COUNT_TIME:
      case AVG:
      case TIME_DURATION:
      case STDDEV:
      case STDDEV_POP:
      case STDDEV_SAMP:
      case VARIANCE:
      case VAR_POP:
      case VAR_SAMP:
      case MAX_BY:
      case MIN_BY:
      case UDAF:
        return true;
      default:
        throw new IllegalArgumentException(
            String.format("Invalid Aggregation function: %s", aggregationFunction));
    }
  }
judge whether the order of aggregation calculation is consistent with the order of traversing
data
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java