@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validateInputSeriesDataType(0, Type.INT32, Type.INT64, Type.FLOAT, Type.DOUBLE)
        .validate(
            x -> (int) x > 0,
            "Window size should be a positive integer.",
            validator.getParameters().getIntOrDefault("window", 10))
        .validate(
            x -> (double) x >= 0,
            "Error bound should be no less than 0.",
            validator.getParameters().getDoubleOrDefault("error", 0.1))
        .validate(
            x ->
                ((String) x).equalsIgnoreCase(METHOD_BOTTOM_UP)
                    || ((String) x).equalsIgnoreCase("swab"),
            "Method is illegal.",
            validator.getParameters().getStringOrDefault("method", METHOD_BOTTOM_UP))
        .validate(
            x ->
                ((String) x).equalsIgnoreCase(OUTPUT_FIRST) || ((String) x).equalsIgnoreCase("all"),
            "Output type is invalid.",
            validator.getParameters().getStringOrDefault("output", OUTPUT_FIRST));
  }
This function segment input series into linear parts.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFSegment.java