Reputation: 659
If I have two files in my input folder, hadoop mapreduce will process both these files as . Is there a way to specify different processing for these two files? Suppose for example that instead of firing 1 for each word I encounter, I want to fire a 1 if this word was in file 1 and a 2 in the case it was seen in file 2 present in the same directory. How would you do that?
Upvotes: 0
Views: 1266
Reputation: 106
You should be able to get the file name as described in this post How to get the input file name in the mapper in a Hadoop program?
Once you have the file name you can have a condition to check for the file name based on that you should be able to fire 1 or 2.
Upvotes: 1