user3765713
user3765713

Reputation: 133

Java Hadoop - Can the input to a reducer be the output of a reducer?

I'm writing a map-reduce program with (currently) 3 map-reduce phases. I need to do another reduce to the output of the 3rd phase reduce - I can use a map of identity (takes (key, value) and outputs them without changing) but I don't want to do that extra map (time and resources wise) and wish to simply pass them to a reducer.

Is it possible? If so, how to I code the "jobs"?

I can post my whole code if it might help (maybe I'm doing something redundant/insufficient in the previous 3 phases).

Thank you for the help.

Upvotes: 1

Views: 190

Answers (1)

siddhartha jain
siddhartha jain

Reputation: 1006

I don't think it will be feasible to use reduce only jobs. Moreover if you want to use reducer2 on output of reducer 1 then you can make your map 2 as a unity which simply means that map2 will do not perform any operation on reducer 1 output and will let it pass to reducer 2.

Major reason why reducer only jobs are not feasible is because reducer node reads data from output of map nodes that is why maps are required. I will suggest you to visit this page this will clear your concept of how map reduce jobs works ( www.javacrunch.in/MR.jsp ).

Hope this solve your query

Upvotes: 2

Related Questions