@Test
  public void asofInnerJoinTest() {
    expectedHeader = new String[] {"time", "device", "level", "time", "device", "level"};
    retArray =
        new String[] {
          "1971-01-01T00:00:00.000Z,d1,l1,1970-01-01T00:00:00.100Z,d1,l5,",
          "1971-01-01T00:01:40.000Z,d1,l1,1971-01-01T00:00:00.000Z,d1,l1,",
          "1971-01-01T00:01:40.000Z,d1,l1,1971-01-01T00:00:00.000Z,d999,null,",
          "1971-01-01T00:01:40.000Z,d1,l1,1971-01-01T00:00:00.000Z,null,l999,",
          "1970-01-01T00:00:00.020Z,d1,l2,1970-01-01T00:00:00.010Z,d11,l11,",
          "1971-01-01T00:00:00.100Z,d1,l2,1971-01-01T00:00:00.000Z,d1,l1,",
          "1971-01-01T00:00:00.100Z,d1,l2,1971-01-01T00:00:00.000Z,d999,null,",
          "1971-01-01T00:00:00.100Z,d1,l2,1971-01-01T00:00:00.000Z,null,l999,",
          "1971-04-26T17:46:40.000Z,d1,l2,1971-01-01T00:00:00.000Z,d1,l1,",
          "1971-04-26T17:46:40.000Z,d1,l2,1971-01-01T00:00:00.000Z,d999,null,"
        };
    // test single join condition
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.time>table1.time "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level limit 10",
        expectedHeader,
        retArray,
        DATABASE_NAME);
    // test expr and '>=' in ASOF condition
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.time>=table1.time+1 "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level limit 10",
        expectedHeader,
        retArray,
        DATABASE_NAME);

    retArray =
        new String[] {
          "1971-01-01T00:00:00.000Z,d1,l1,1970-01-01T00:00:00.000Z,d1,l1,",
          "1971-01-01T00:01:40.000Z,d1,l1,1971-01-01T00:00:00.000Z,d1,l1,",
          "1971-01-01T00:00:00.100Z,d1,l2,1970-01-01T00:00:00.020Z,d1,l2,",
          "1971-04-26T17:46:40.000Z,d1,l2,1970-01-01T00:00:00.020Z,d1,l2,",
          "1971-01-01T00:00:00.500Z,d1,l3,1970-01-01T00:00:00.040Z,d1,l3,",
          "1971-04-26T17:46:40.020Z,d1,l3,1970-01-01T00:00:00.040Z,d1,l3,",
          "1971-01-01T00:00:01.000Z,d1,l4,1970-01-01T00:00:00.080Z,d1,l4,",
          "1971-04-26T18:01:40.000Z,d1,l4,1970-01-01T00:00:00.080Z,d1,l4,",
          "1971-01-01T00:00:10.000Z,d1,l5,1970-01-01T00:00:00.100Z,d1,l5,",
          "1971-08-20T11:33:20.000Z,d1,l5,1970-01-01T00:00:00.100Z,d1,l5,"
        };
    // test multi join conditions
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.device=table1.device and table1.level=table0.level and table0.time>table1.time "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level",
        expectedHeader,
        retArray,
        DATABASE_NAME);
    // test expr and '>=' in ASOF condition
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.device=table1.device and table1.level=table0.level and table0.time>=table1.time+1 "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level",
        expectedHeader,
        retArray,
        DATABASE_NAME);

    retArray =
        new String[] {
          "1970-01-01T00:00:00.000Z,d1,l1,1970-01-01T00:00:00.010Z,d11,l11,",
          "1970-01-01T00:00:00.020Z,d1,l2,1970-01-01T00:00:00.030Z,d11,l11,",
          "1970-01-01T00:00:00.040Z,d1,l3,1970-01-01T00:00:00.080Z,d1,l4,",
          "1970-01-01T00:00:00.080Z,d1,l4,1970-01-01T00:00:00.100Z,d1,l5,",
          "1970-01-01T00:00:00.100Z,d1,l5,1971-01-01T00:00:00.000Z,d1,l1,",
          "1970-01-01T00:00:00.100Z,d1,l5,1971-01-01T00:00:00.000Z,d999,null,",
          "1970-01-01T00:00:00.100Z,d1,l5,1971-01-01T00:00:00.000Z,null,l999,",
          "1970-01-01T00:00:00.000Z,d2,l1,1970-01-01T00:00:00.010Z,d11,l11,",
          "1970-01-01T00:00:00.020Z,d2,l2,1970-01-01T00:00:00.030Z,d11,l11,",
          "1970-01-01T00:00:00.040Z,d2,l3,1970-01-01T00:00:00.080Z,d1,l4,"
        };
    // test single join condition
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.time<table1.time "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level limit 10",
        expectedHeader,
        retArray,
        DATABASE_NAME);
    // test expr and '<=' in ASOF condition
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.time<=table1.time-1 "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level limit 10",
        expectedHeader,
        retArray,
        DATABASE_NAME);

    retArray =
        new String[] {
          "1970-01-01T00:00:00.000Z,d1,l1,1971-01-01T00:00:00.000Z,d1,l1,",
        };
    // test multi join conditions
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.device=table1.device and table1.level=table0.level and table0.time<table1.time "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level",
        expectedHeader,
        retArray,
        DATABASE_NAME);
    // test expr and '>=' in ASOF condition
    tableResultSetEqualTest(
        "select table0.time,table0.device,table0.level,table1.time,table1.device,table1.level from table0 asof join table1 on "
            + "table0.device=table1.device and table1.level=table0.level and table0.time<=table1.time-1 "
            + "order by table0.device,table0.level,table0.time,table1.device,table1.level",
        expectedHeader,
        retArray,
        DATABASE_NAME);
  }
In this IT, table has more than one TAGs and Attributes.
integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java