You are viewing a single comment's thread. Return to all comments →
def mapper(record): #Start writing the Map code here words = record.rstrip().split(',') if words[0] == 'Department': mapReducer.emitIntermediate(words[1], ('D', words[2]) ) else: mapReducer.emitIntermediate(words[2], ('E', words[1]) ) def reducer(key, list_of_values): #Start writing the Reduce code here sl = sorted(list_of_values) for d in [x[1] for x in sl if x[0]=='D']: mapReducer.emit((key, sl[-1][-1], d))
Map Reduce Advanced - Relational Join
You are viewing a single comment's thread. Return to all comments →