天天看點

mapreduce 模闆代碼詳解MapReduce實作資料去重與反向索引應用場景案例

jai包

2.x以後就拆成一些零散的包了,沒有core包了

代碼:

反向索引代碼

輸入檔案如下:

13588888888 112

13678987879 13509098987

18987655436 110

2543789    112

15699807656 110

011-678987 112

說明:每一行為一條電話通話記錄,左邊的号碼(記為a)打給右邊的号碼(記為b号碼),中間用空格隔開

要求:

将以上檔案以如下格式輸出:

110 18987655436|15699807656

112 13588888888|011-678987

13509098987 13678987879

說明:左邊為被呼叫的号碼b,右邊為呼叫b的号碼a以"|"分割

去重代碼

參考文章;

一個經典的mapreduce模闆代碼,反向索引(reverseindex)

<a href="http://blog.itpub.net/26400547/viewspace-1214945/" target="_blank">http://blog.itpub.net/26400547/viewspace-1214945/</a>

<a href="http://www.tuicool.com/articles/emi6fb" target="_blank">http://www.tuicool.com/articles/emi6fb</a>