public double getMad() throws UDFInputSeriesDataTypeNotValidException {
    switch (dataType) {
      case INT32:
        return getMad(intArrayList);
      case INT64:
        return getMad(longArrayList);
      case FLOAT:
        return getMad(floatArrayList);
      case DOUBLE:
        return getMad(doubleArrayList);
      case TIMESTAMP:
      case DATE:
      case BLOB:
      case BOOLEAN:
      case STRING:
      case TEXT:
      default:
        // This will not happen.
        throw new UDFInputSeriesDataTypeNotValidException(
            0, dataType, Type.INT32, Type.INT64, Type.FLOAT, Type.DOUBLE);
    }
  }
Util for computing median, MAD, percentile.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/ExactOrderStatistics.java