@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validateInputSeriesNumber(1)
        .validateInputSeriesDataType(0, Type.INT32, Type.INT64, Type.FLOAT, Type.DOUBLE)
        .validate(
            x -> (int) x > 0,
            "window has to be a positive integer.",
            validator.getParameters().getIntOrDefault("window", 10))
        .validate(
            x -> (double) x >= 0.0d,
            "threshold has to be non-negative.",
            validator.getParameters().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