@Override
  public void beforeStart(UDFParameters parameters, UDTFConfigurations configurations)
      throws Exception {
    window = parameters.getIntOrDefault("window", 10);
    configurations
        .setAccessStrategy(new SlidingSizeWindowAccessStrategy(window, 1))
        .setOutputDataType(Type.DOUBLE);
    threshold = parameters.getDoubleOrDefault("threshold", Double.MAX_VALUE);
  }
This function finds symmetric patterns in a series according to DTW distance.
library-udf/src/main/java/org/apache/iotdb/library/dmatch/UDTFPtnSym.java