@Test
  public void do_test()
      throws InterruptedException,
          TException,
          IoTDBConnectionException,
          IOException,
          StatementExecutionException {
    String sql =
        "select count(s_0) from "
            + device
            + " where time >= 2024-01-01T00:00:00+08:00 and time <= 2024-03-31T23:59:59+08:00";
    consumer = create_pull_consumer("ts_accurate_dataset_pull", "loose_range_all", false, null);
    // Write data before subscribing
    insert_data(1704038396000L, device); // 2023-12-31 23:59:56+08:00
    insert_data(1704038396000L, device2); // 2023-12-31 23:59:56+08:00
    System.out.println("src filter:" + getCount(session_src, sql));
    // Subscribe
    consumer.subscribe(topicName);
    subs.getSubscriptions().forEach(System.out::println);
    assertEquals(subs.getSubscriptions().size(), 1, "show subscriptions after subscription");

    // Before consumption subscription data
    consume_data(consumer, session_dest);
    check_count_non_strict(
        3, "select count(s_0) from " + device, "Start time boundary data: s_0 " + device);
    check_count(0, "select count(s_1) from " + device, "Start time boundary data: s_1 " + device);
    check_count(0, "select count(s_0) from " + device2, "Start time boundary data: s_0 " + device2);
    check_count(0, "select count(s_1) from " + device2, "Start time boundary data: s_1 " + device2);

    insert_data(System.currentTimeMillis(), device); // now
    insert_data(System.currentTimeMillis(), device2); // now
    System.out.println("src filter:" + getCount(session_src, sql));
    consume_data(consumer, session_dest);
    check_count_non_strict(
        3, "select count(s_0) from " + device, "Write some real-time data later:s_0 " + device);
    check_count(
        0, "select count(s_1) from " + device, "Write some real-time data later: s_1 " + device);
    check_count(0, "select count(s_0) from " + device2, "not in range: s_0 " + device2);
    check_count(0, "select count(s_1) from " + device2, "not in range: s_1 " + device2);

    insert_data(1707782400000L, device); // 2024-02-13 08:00:00+08:00
    insert_data(1707782400000L, device2); // 2024-02-13 08:00:00+08:00
    consume_data(consumer, session_dest);
    System.out.println("src filter:" + getCount(session_src, sql));
    check_count_non_strict(
        8, "select count(s_0) from " + device, "data within the time range: s_0 " + device);
    check_count(0, "select count(s_1) from " + device, "data within the time range: s_1 " + device);
    check_count(
        0, "select count(s_0) from " + device2, "data within the time range: s_0 " + device2);
    check_count(
        0, "select count(s_1) from " + device2, "data within the time range: s_1 " + device2);

    insert_data(1711814398000L, device); // 2024-03-30 23:59:58+08:00
    insert_data(1711814398000L, device2); // 2024-03-30 23:59:58+08:00
    System.out.println("src filter:" + getCount(session_src, sql));
    consume_data(consumer, session_dest);
    check_count_non_strict(
        13, "select count(s_0) from " + device, "End time limit data: s_0 " + device);
    check_count(0, "select count(s_1) from " + device, "End time limit data: s_1" + device);
    check_count(0, "select count(s_0) from " + device2, "End time limit data: s_0" + device2);
    check_count(0, "select count(s_1) from " + device2, "End time limit data: s_1" + device2);

    insert_data(1711900798000L, device); // 2024-03-31 23:59:58+08:00
    insert_data(1711900798000L, device2); // 2024-03-31 23:59:58+08:00
    System.out.println("src filter:" + getCount(session_src, sql));
    consume_data(consumer, session_dest);
    check_count_non_strict(
        14, "select count(s_0) from " + device, "End time limit data 2:s_0 " + device);
    check_count(0, "select count(s_1) from " + device, "End time limit data 2:s_1" + device);
    check_count(0, "select count(s_0) from " + device2, "End time limit data 2: s_0" + device2);
    check_count(0, "select count(s_1) from " + device2, "End time limit data 2: s_1" + device2);

    consumer.unsubscribe(topicName);
    consumer.subscribe(topicName);
    consume_data(consumer, session_dest);
    check_count_non_strict(
        14, "select count(s_0) from " + device, "End time limit data 2:s_0 " + device);
    check_count(0, "select count(s_1) from " + device, "End time limit data 2:s_1" + device);
    check_count(0, "select count(s_0) from " + device2, "End time limit data 2: s_0" + device2);
    check_count(0, "select count(s_1) from " + device2, "End time limit data 2: s_1" + device2);
  }
pull consumer
pattern: ts
accurate time
format: dataset
integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/treemodel/regression/pullconsumer/loose_range/IoTDBAllTsDatasetPullConsumerIT.java