@Test
  public void testUDF_UDAF() throws ParseException {
    parse("select count(*), count(c_int), sum(c_int), avg(c_int), max(c_int), min(c_int) from `c/b/o_t1`");
    parse("select count(*), count(c_int) as a, sum(c_int), avg(c_int), max(c_int), min(c_int), case c_int when 0  then 1 when 1 then 2 else 3 end, sum(case c_int when 0  then 1 when 1 then 2 else 3 end) from `c/b/o_t1` group by c_int order by a");
    parse("select * from (select count(*) as a, count(distinct c_int) as b, sum(c_int) as c, avg(c_int) as d, max(c_int) as e, min(c_int) as f from `c/b/o_t1`) `c/b/o_t1`");
    parse("select * from (select count(*) as a, count(distinct c_int) as b, sum(c_int) as c, avg(c_int) as d, max(c_int) as e, min(c_int) as f, case c_int when 0  then 1 when 1 then 2 else 3 end as g, sum(case c_int when 0  then 1 when 1 then 2 else 3 end) as h from `c/b/o_t1` group by c_int) `c/b/o_t1` order by a");
    parse("select f,a,e,b from (select count(*) as a, count(c_int) as b, sum(c_int) as c, avg(c_int) as d, max(c_int) as e, min(c_int) as f from `c/b/o_t1`) `c/b/o_t1`");
    parse("select f,a,e,b from (select count(*) as a, count(distinct c_int) as b, sum(distinct c_int) as c, avg(distinct c_int) as d, max(distinct c_int) as e, min(distinct c_int) as f from `c/b/o_t1`) `c/b/o_t1`");
    parse("select key,count(c_int) as a, avg(c_float) from `c/b/o_t1` group by key order by a");
    parse("select count(distinct c_int) as a, avg(c_float) from `c/b/o_t1` group by c_float order by a");
    parse("select count(distinct c_int) as a, avg(c_float) from `c/b/o_t1` group by c_int order by a");
    parse("select count(distinct c_int) as a, avg(c_float) from `c/b/o_t1` group by c_float, c_int order by a");
  }
Parser tests special character in table names.
parser/src/test/org/apache/hadoop/hive/ql/parse/TestSpecialCharacterInTableNames.java