Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8. (2pts as bonus) consider a retail table where each row contains the following attributes: datelD, customerID, storeID, City-of-store, productID, Category-of-product, and sale. One record
8. (2pts as bonus) consider a retail table where each row contains the following attributes: datelD, customerID, storeID, City-of-store, productID, Category-of-product, and sale. One record example is like 1/1/2014, C10001, S25, New York, P157, food, $100. For the query task, calculate the total sale value for each product and at each store from New York. A group-by SQL query is: Select productID, storelD, sum(sale) from retail where City-of-store=New York' group by productID, storelD. Now assume we have the text raw file extracted from the above table and would use the map-reduce framework to implement the above query task. Please show the pseudo code of the map function and reduce function. 8. (2pts as bonus) consider a retail table where each row contains the following attributes: datelD, customerID, storeID, City-of-store, productID, Category-of-product, and sale. One record example is like 1/1/2014, C10001, S25, New York, P157, food, $100. For the query task, calculate the total sale value for each product and at each store from New York. A group-by SQL query is: Select productID, storelD, sum(sale) from retail where City-of-store=New York' group by productID, storelD. Now assume we have the text raw file extracted from the above table and would use the map-reduce framework to implement the above query task. Please show the pseudo code of the map function and reduce function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started