-- Queries begin

create table temp.sort_bug (t_date date, s string) stored as orc;
    
insert into temp.sort_bug values ('2020-04-11', 'a'),('2020-04-11', 'b'),('2020-04-10', 'a'),('2020-04-12', 'a');

-- yields 2 rows for above data set
SELECT count(1) FROM(
     SELECT t_date, s asc
    FROM temp.sort_bug
    GROUP BY t_date, s
) a;

-- yields 1 row for above mentioned data set
SELECT count(1) FROM(
     SELECT t_date, s asc
    FROM temp.sort_bug
    GROUP BY t_date, s
) a limit 1;

-- Queries end