@Override
  public void transform(Row row, PointCollector collector) throws Exception {
    switch (dataType) {
      case BOOLEAN:
        if (isFirst) {
          isFirst = false;
          cacheBoolean = row.getBoolean(0);
          collector.putBoolean(row.getTime(), cacheBoolean);
        } else {
          boolean rowData = row.getBoolean(0);
          if (rowData != cacheBoolean) {
            cacheBoolean = rowData;
            collector.putBoolean(row.getTime(), cacheBoolean);
          }
        }
        break;
      case INT32:
        if (isFirst) {
          isFirst = false;
          cacheInt = row.getInt(0);
          collector.putInt(row.getTime(), cacheInt);
        } else {
          int rowData = row.getInt(0);
          if (rowData != cacheInt) {
            cacheInt = rowData;
            collector.putInt(row.getTime(), cacheInt);
          }
        }
        break;
      case INT64:
        if (isFirst) {
          isFirst = false;
          cacheLong = row.getLong(0);
          collector.putLong(row.getTime(), cacheLong);
        } else {
          long rowData = row.getLong(0);
          if (rowData != cacheLong) {
            cacheLong = rowData;
            collector.putLong(row.getTime(), cacheLong);
          }
        }
        break;
      case FLOAT:
        if (isFirst) {
          isFirst = false;
          cacheFloat = row.getFloat(0);
          collector.putFloat(row.getTime(), cacheFloat);
        } else {
          float rowData = row.getFloat(0);
          if (rowData != cacheFloat) {
            cacheFloat = rowData;
            collector.putFloat(row.getTime(), cacheFloat);
          }
        }
        break;
      case DOUBLE:
        if (isFirst) {
          isFirst = false;
          cacheDouble = row.getDouble(0);
          collector.putDouble(row.getTime(), cacheDouble);
        } else {
          double rowData = row.getDouble(0);
          if (rowData != cacheDouble) {
            cacheDouble = rowData;
            collector.putDouble(row.getTime(), cacheDouble);
          }
        }
        break;
      case TEXT:
        if (isFirst) {
          isFirst = false;
          cacheString = row.getString(0);
          collector.putString(row.getTime(), cacheString);
        } else {
          String rowData = row.getString(0);
          if (!rowData.equals(cacheString)) {
            cacheString = rowData;
            collector.putString(row.getTime(), cacheString);
          }
        }
      case STRING:
      case BLOB:
      case DATE:
      case TIMESTAMP:
      default:
        break;
    }
  }
Return a series that the consecutive identical values in input series are removed (keeping only
the first one).
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/builtin/UDTFChangePoints.java