@Override
  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
      throws Exception {
    configurations.setAccessStrategy(new RowByRowAccessStrategy()).setOutputDataType(Type.DOUBLE);
    dataType = parameters.getDataType(0);
    windowSize = parameters.getIntOrDefault("window", 10);
    v = new DoubleCircularQueue(windowSize);
  }
This function calculates moving average of given window length of input series.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFMvAvg.java