@Override
  public void transform(Row row, PointCollector pc) throws Exception {
    switch (dataType) {
      case INT32:
        intSet.add(row.getInt(0));
        break;
      case INT64:
        longSet.add(row.getLong(0));
        break;
      case FLOAT:
        floatSet.add(row.getFloat(0));
        break;
      case DOUBLE:
        doubleSet.add(row.getDouble(0));
        break;
      case TEXT:
        stringSet.add(row.getString(0));
        break;
      case BOOLEAN:
        booleanSet.add(row.getBoolean(0));
        break;
      case BLOB:
      case STRING:
      case TIMESTAMP:
      case DATE:
      default:
        break;
    }
  }
This function counts number of distinct values of input series.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFDistinct.java