@Override
  public void transform(Row row, PointCollector collector) throws Exception {
    int intValue;
    long longValue;
    float floatValue;
    double doubleValue;
    long timestamp;
    timestamp = row.getTime();
    switch (dataType) {
      case INT32:
        intValue = row.getInt(0);
        if (intValue > upperBound || intValue < lowerBound) {
          collector.putInt(timestamp, intValue);
        }
        break;
      case INT64:
        longValue = row.getLong(0);
        if (longValue > upperBound || longValue < lowerBound) {
          collector.putLong(timestamp, longValue);
        }
        break;
      case FLOAT:
        floatValue = row.getFloat(0);
        if (floatValue > upperBound || floatValue < lowerBound) {
          collector.putFloat(timestamp, floatValue);
        }
        break;
      case DOUBLE:
        doubleValue = row.getDouble(0);
        if (doubleValue > upperBound || doubleValue < lowerBound) {
          collector.putDouble(timestamp, doubleValue);
        }
        break;
      case DATE:
      case TIMESTAMP:
      case TEXT:
      case STRING:
      case BOOLEAN:
      case BLOB:
      default:
        throw new UDFException("No such kind of data type.");
    }
  }
This function is used to detect range anomaly of time series.
library-udf/src/main/java/org/apache/iotdb/library/anomaly/UDTFRange.java