private static void generateData() {
    // SessionWindow
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {
      for (int i = 0; i < ITERATION_TIMES; ++i) {
        if (i == 5 || i == 6 || i == 7 || i == 51 || i == 52 || i == 53 || i == 54 || i == 996
            || i == 997 || i == 998) {
          continue;
        }
        statement.execute(
            (String.format("insert into root.vehicle.d1(timestamp,s3) values(%d,%d)", i, i)));
      }

      // StateWindow INT32
      for (int i = 0; i < ITERATION_TIMES; ++i) {
        if (i == 1 || i == 2 || i == 3 || i == 15 || i == 17 || i == 53 || i == 54 || i == 996
            || i == 997 || i == 998) {
          statement.execute(
              (String.format(
                  "insert into root.vehicle.d1(timestamp,s4) values(%d,%d)", i, i + 100)));
        } else if (i == 500 || i == 501) {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s4) values(%d,%d)", i, 12)));
        } else if (i % 2 == 0) {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s4) values(%d,%d)", i, 0)));
        } else {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s4) values(%d,%d)", i, 3)));
        }
      }

      // StateWindow BOOLEAN
      for (int i = 0; i < ITERATION_TIMES; ++i) {
        if (i == 1 || i == 2 || i == 3 || i == 15 || i == 17 || i == 53 || i == 54 || i == 996
            || i == 997 || i == 998) {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s5) values(%d, true)", i)));
        } else {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s5) values(%d, false)", i)));
        }
      }

      // StateWindow TEXT
      for (int i = 0; i < ITERATION_TIMES; ++i) {
        if (i < 500) {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s6) values(%d, '<500')", i)));
        } else if (i < 993) {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s6) values(%d, '<993')", i)));
        } else {
          statement.execute(
              (String.format("insert into root.vehicle.d1(timestamp,s6) values(%d, '>=994')", i)));
        }
      }
    } catch (SQLException throwable) {
      fail(throwable.getMessage());
    }
  }
Test for SessionWindow, StateWindow and UserDefinedWindow.
integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFOtherWindowQueryIT.java