0

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?

giulio
  • 659
  • 2
  • 8
  • 22

1 Answers1

1

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.

Community
  • 1
  • 1
Prahalad
  • 106
  • 8