select count(distinct *) from table;
這樣寫會生成一個job 只有一個reducer執行,可以改爲如下:
select count(*) from (
select distinct * from table) t;
這樣生成兩個job,可有多個reducer執行,效率提升
select count(distinct *) from table;
這樣寫會生成一個job 只有一個reducer執行,可以改爲如下:
select count(*) from (
select distinct * from table) t;
這樣生成兩個job,可有多個reducer執行,效率提升