What if the reducer's output is different from mapper's output? Every documentation say it will throw error. But my question is WHY?
Reducer's output is endpoint, So why it does matter that if its different from mapper's output then it needs to be set using setMapoutputkeyclass and setMapoutputvalueclass methods... WHY IS IT REQUIRED? WHAT WILL HAPPEN if it doesn't match and not set by methods except from error?
What it takes care of when we set output types using these two methods?
Can anyone share behind this concept? I'm looking for this for a long time
Edit....!
We set up generic arguments in our mapper reducer classes to avoid runtime exception. But when we start running it turns into Object type(Java erausre).
So that means when Mapper's output stores into context.write(new Text(Year), new IntWritable(airTemp)), At run time its a bytes of data stored into object types. And when reducer class called it takes that raw bytes from mapper and produce output in raw bytes only. By default Mapper and Reducer output types are same but when its different we set using above methods. And using those methods Hadoop framework convert those raw bytes into specific type and writes into output file.
Does it makes sense...?