fails when using hadoop streaming with python combiner
问题 I try to use hadoop streaming by python to compute average values of of input keys. Here are the codes of mapper, combiner and reducer: #mapper: import sys def map(argv): line = sys.stdin.readline() try: while line: word, num = line.split() num = int(num) print word+'\t'+str(num) line = sys.stdin.readline() except Exception, ex: print 'mapper ex:'+str(ex) return None if __name__ == "__main__": map(sys.argv) #combiner import sys def combine(argv): line = sys.stdin.readline() cur_word = '' cur