@Test
  public void optimizedPlanTest() {

    String[] expectedHeader =
        new String[] {"time", "plant_id", "device_id", "temperature", "status", "hardware"};
    String[] retArray =
        new String[] {
          "2017-10-31T16:01:00.000Z,wf02,wt02,null,true,v2,",
          "2017-10-31T16:01:00.000Z,wf01,wt01,24.36,true,null,",
          "2017-10-31T16:00:00.000Z,wf02,wt02,null,false,v2,",
          "2017-10-31T16:00:00.000Z,wf01,wt01,25.96,true,null,",
          "1970-01-01T00:00:00.002Z,wf02,wt02,null,false,v2,",
          "1970-01-01T00:00:00.001Z,wf02,wt02,null,true,v1,",
        };

    tableResultSetEqualTest(
        "SELECT * FROM optimize ORDER BY Time DESC,plant_id DESC,device_id desc",
        expectedHeader,
        retArray,
        DATABASE_NAME);
  }
This method generate test data with crossing time.

<p>The data can be viewed in online doc:

<p>https://docs.google.com/spreadsheets/d/18XlOIi27ZIIdRnar2WNXVMxkZwjgwlPZmzJLVpZRpAA/edit#gid=0
integration-test/src/test/java/org/apache/iotdb/relational/it/query/view/old/alignbydevice/IoTDBOrderByWithAlignByDeviceTableViewIT.java