abctoxyz
BAN USER
Questions (1)
Comments (6)
Reputation 10
- 0of 0 votes
AnswersWe have table:
- abctoxyz in United States
create table employee (id int, name varchar, salary decimal, mgr_id int);
We want to print name and salary of employees that make more than their manager or don't have a manager.
This can be done by the following SQL:
select name, salary
from employee e, employee m
where e.salary > m.salary and e.mgr_id = m.id;
Question: how to do this with Hadoop? Write down the function for the mapper and reducer respectively.
map: k,v -> (k’,v’):
reduce: k, <list v>, ->k’, v’:| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
No. The manager's associated list just includes his employee's salary, and his own salary will be in list associated with his manager.
- abctoxyz December 16, 2012