Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions