We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Map Reduce Advanced - Relational Join
Map Reduce Advanced - Relational Join
Sort by
recency
|
12 Discussions
|
Please Login in order to post a comment
Copilot solution:
from collections import OrderedDict import sys
class MapReduce: def init(self): self.intermediate = OrderedDict() self.result = []
mapReducer = MapReduce()
def mapper(record): #Start writing the Map code here fields = record.replace('\n', '').split(',')
def reducer(key, list_of_values): #Start writing the Reduce code here person_names = [] department_names = [] for label, value in list_of_values: if label == 'Employee': person_names.append(value) else: department_names.append(value)
if name == 'main': inputData = [] for line in sys.stdin: inputData.append(line) mapReducer.execute(inputData, mapper, reducer)
Here is Map Reduce Advanced - Relational Join problem solution - https://www.gyangav.com/2022/11/hackerrank-map-reduce-advanced-relational-join-problem-solution.html