@Test
  public void testOutputLayout() {
    // ONE ROW PER MATCH: PK, Measures
    String[] expectedHeader1 = new String[] {"part", "match", "label"};
    String[] retArray1 =
        new String[] {
          "p1,1,A,",
        };

    // ALL ROWS PER MATCH: PK, OK, Measures, Others
    String[] expectedHeader2 = new String[] {"part", "num", "match", "label", "time", "totalprice"};
    String[] retArray2 =
        new String[] {
          "p1,1,1,A,2025-01-01T00:01:00.000Z,10.0,",
        };

    String sql =
        "SELECT * "
            + "FROM t5 "
            + "MATCH_RECOGNIZE ( "
            + "    PARTITION BY part "
            + "    ORDER BY num "
            + "    MEASURES "
            + "        MATCH_NUMBER() AS match, "
            + "        CLASSIFIER() AS label "
            + "    %s "
            + "    PATTERN (A+) "
            + "    DEFINE "
            + "        A AS true "
            + ") AS m ";

    tableResultSetEqualTest(
        format(sql, "ONE ROW PER MATCH"), expectedHeader1, retArray1, DATABASE_NAME);
    tableResultSetEqualTest(
        format(sql, "ALL ROWS PER MATCH"), expectedHeader2, retArray2, DATABASE_NAME);
  }
Search range: all devices whose department is 'DEP_1', each device's data is grouped
separately, and the time range is between 2025-01-01T00:00:00 and 2025-01-01T01:00:00.

<p>Event analysis: Whenever the altitude exceeds 500 and then drops below 500, it is marked as
an event.
integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBPatternRecognitionIT.java