天天看点

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>