我MapReduce的工作與WORDCOUNT示例的值: 輸入數據:輸出減少一個密鑰一起
text files
輸出:
term: fileName occurrences
地圖輸出:
Term:filename 1 1 1 1 1
減少輸出:
代碼最終輸出「減速機的輸出」的3210Term: filename occurences
例子:
Iphone: file1 4
Iphone: file2 3
Galaxy: file1 2
Htc: file1 3
Htc file2 5
輸出我想
Iphone: file1=4 file2=3
Galaxy: file1=2
Htc: file1=3 file2=5
我怎樣才能得到這種情況下,我想過使用分區功能,把我不知道該怎麼做?任何建議? 在此先感謝
代碼輸出示例 - 是您的映射器輸出? –
@siddharthajain從減速機輸出「最終輸出」 – user5532529
你在地圖輸出中的關鍵是什麼,它的格式是什麼? –