hive distict 和 count 操作reducer只有一个的问题

select count(distinct *) from table;

这样写会生成一个job 只有一个reducer执行,可以改为如下:

select count(*) from (

select distinct * from table) t;

这样生成两个job,可有多个reducer执行,效率提升