MRJob :- Display intermediate values in map reduce MRJob :- Display intermediate values in map reduce hadoop hadoop

MRJob :- Display intermediate values in map reduce


You can output the results to standard error using sys.stderr.write(). Here is an example:

from mrjob.job import MRJobimport sysclass MRWordCounter(MRJob):    def mapper(self, key, line):        sys.stderr.write("MAPPER INPUT: ({0},{1})\n".format(key,line))        for word in line.split():            yield word, 1    def reducer(self, word, occurrences):        occurencesList= list(occurrences)        sys.stderr.write("REDUCER INPUT: ({0},{1})\n".format(word,occurencesList))        yield word, sum(occurencesList)if __name__ == '__main__':    MRWordCounter.run()