@Ignore
  @Test
  public void groupByWithWildcardTest3() throws SQLException {
    String[] retArray =
        new String[] {
          "1,null,null,null,null,null",
          "5,7.0,7,7,false,aligned_test7",
          "9,11.0,11,11,true,aligned_test10",
          "13,15.0,15,15,true,aligned_unseq_test13",
          "17,19.0,19,19,null,null",
          "21,230000.0,null,230000,false,null",
          "25,null,null,27,false,null",
          "29,null,31,30,false,aligned_test31",
          "33,null,35,null,null,aligned_test35",
          "37,null,37,null,null,aligned_test37"
        };
    try (Connection connection = EnvFactory.getEnv().getTableConnection();
        Statement statement = connection.createStatement()) {

      int cnt;
      try (ResultSet resultSet =
          statement.executeQuery(
              "select last_value(*) from d1 "
                  + "where time > 5 and time < 38 GROUP BY ([1, 41), 3ms, 4ms)")) {
        cnt = 0;
        while (resultSet.next()) {
          String ans =
              resultSet.getString(TIMESTAMP_STR)
                  + ","
                  + resultSet.getString(lastValue("d1.s1"))
                  + ","
                  + resultSet.getString(lastValue("d1.s2"))
                  + ","
                  + resultSet.getString(lastValue("d1.s3"))
                  + ","
                  + resultSet.getString(lastValue("d1.s4"))
                  + ","
                  + resultSet.getString(lastValue("d1.s5"));
          Assert.assertEquals(retArray[cnt], ans);
          cnt++;
        }
        Assert.assertEquals(retArray.length, cnt);
      }

      try (ResultSet resultSet =
          statement.executeQuery(
              "select last_value(*) from d1 "
                  + " where time > 5 and time < 38 GROUP BY ([1, 41), 3ms, 4ms) order by time desc")) {
        cnt = retArray.length;
        while (resultSet.next()) {
          String ans =
              resultSet.getString(TIMESTAMP_STR)
                  + ","
                  + resultSet.getString(lastValue("d1.s1"))
                  + ","
                  + resultSet.getString(lastValue("d1.s2"))
                  + ","
                  + resultSet.getString(lastValue("d1.s3"))
                  + ","
                  + resultSet.getString(lastValue("d1.s4"))
                  + ","
                  + resultSet.getString(lastValue("d1.s5"));
          Assert.assertEquals(retArray[cnt - 1], ans);
          cnt--;
        }
        Assert.assertEquals(0, cnt);
      }
    }
  }
aggregate multi columns of aligned timeseries in one SQL
integration-test/src/test/java/org/apache/iotdb/relational/it/query/view/old/aligned/IoTDBAlignedSeriesQueryTableViewIT.java