@Override
  public void transform(RowWindow rowWindow, PointCollector collector)
      throws UDFException, IOException {
    switch (dataType) {
      case INT32:
        transformInt(rowWindow, collector);
        break;
      case INT64:
        transformLong(rowWindow, collector);
        break;
      case FLOAT:
        transformFloat(rowWindow, collector);
        break;
      case DOUBLE:
        transformDouble(rowWindow, collector);
        break;
      case BLOB:
      case DATE:
      case STRING:
      case TIMESTAMP:
      case BOOLEAN:
      case TEXT:
      default:
        // This will not happen
        throw new UDFInputSeriesDataTypeNotValidException(
            0,
            UDFDataTypeTransformer.transformToUDFDataType(dataType),
            Type.INT32,
            Type.INT64,
            Type.FLOAT,
            Type.DOUBLE);
    }
  }
For each sliding window, M4 returns the first, last, bottom, top points. The window can be
controlled by either point size or time interval length. The aggregated points in the output
series has been sorted and deduplicated.

<p>SlidingSizeWindow usage Example: "select M4(s1,'windowSize'='10','slidingStep'='10') from
root.vehicle.d1" (windowSize is required, slidingStep is optional.)

<p>SlidingTimeWindow usage Example: "select
M4(s1,'timeInterval'='25','slidingStep'='25','displayWindowBegin'='0','displayWindowEnd'='100')
from root.vehicle.d1" (timeInterval is required, slidingStep/displayWindowBegin/displayWindowEnd
are optional.)
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/UDTFM4.java