@Test
  public void UDAFGroupByLevelWithAliasTest() throws Exception {
    String[] expected = new String[] {"5", "5", "5"};
    try (Connection connection = EnvFactory.getEnv().getConnection();
        Statement statement = connection.createStatement()) {

      int cnt = 0;
      try (ResultSet resultSet =
          statement.executeQuery(
              "SELECT count_udaf(temperature) AS ct "
                  + "FROM root.sg1.d1, root.sg1.d2 "
                  + "GROUP BY LEVEL=1")) {
        while (resultSet.next()) {
          String actual = resultSet.getString("ct");
          Assert.assertEquals(expected[cnt], actual);
          cnt++;
        }
      }

      cnt = 0;
      try (ResultSet resultSet =
          statement.executeQuery(
              "SELECT count_udaf(temperature) AS ct " + "FROM root.sg1.* " + "GROUP BY LEVEL=1")) {
        while (resultSet.next()) {
          String actual = resultSet.getString("ct");
          Assert.assertEquals(expected[cnt], actual);
          cnt++;
        }
      }
    }
  }
[root.sg.d1.temperature, root.sg.d2.temperature] with level = 1

<p>Result is [root.sg.*.temperature]
integration-test/src/test/java/org/apache/iotdb/db/it/udaf/IoTDBUDAFGroupByLevelIT.java