<< Prev Question Next Question >>

Question 47/50

CORRECT TEXT
Problem Scenario 77 : You have been given MySQL DB with following details.
user=retail_dba
password=cloudera
database=retail_db
table=retail_db.orders
table=retail_db.order_items
jdbc URL = jdbc:mysql://quickstart:3306/retail_db
Columns of order table : (orderid , order_date , order_customer_id, order_status)
Columns of ordeMtems table : (order_item_id , order_item_order_ld ,
order_item_product_id, order_item_quantity,order_item_subtotal,order_
item_product_price)
Please accomplish following activities.
1. Copy "retail_db.orders" and "retail_db.order_items" table to hdfs in respective directory p92_orders and p92 order items .
2 . Join these data using orderid in Spark and Python
3 . Calculate total revenue perday and per order
4. Calculate total and average revenue for each date. - combineByKey
-aggregateByKey

Recent Comments (The most recent comments are at the top.)

shivam - Sep 12, 2019

can you explain the below line
dateAndRevenueTuple.combineByKey( \
lambda revenue: (revenue, 1), \
lambda revenueSumTuple, amount: (revenueSumTuple[0] + amount, revenueSumTuple[1]
+ 1), \
lambda tuplel, tuple2: (round(tuple1[0] + tuple2[0], 2}, tuple1[1] + tuple2[1])

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Question List (50q)
Question 1: CORRECT TEXT Problem Scenario 12 : You have been given follo...
Question 2: CORRECT TEXT Problem Scenario 92 : You have been given a spa...
Question 3: CORRECT TEXT Problem Scenario 20 : You have been given MySQL...
Question 4: CORRECT TEXT Problem Scenario 33 : You have given a files as...
Question 5: CORRECT TEXT Problem Scenario 88 : You have been given below...
Question 6: CORRECT TEXT Problem Scenario GG : You have been given below...
Question 7: CORRECT TEXT Problem Scenario 2 : There is a parent organiza...
Question 8: CORRECT TEXT Problem Scenario 45 : You have been given 2 fil...
Question 9: CORRECT TEXT Problem Scenario 50 : You have been given below...
Question 10: CORRECT TEXT Problem Scenario 6 : You have been given follow...
Question 11: CORRECT TEXT Problem Scenario 75 : You have been given MySQL...
Question 12: CORRECT TEXT Problem Scenario 73 : You have been given data ...
Question 13: CORRECT TEXT Problem Scenario 9 : You have been given follow...
Question 14: CORRECT TEXT Problem Scenario 27 : You need to implement nea...
Question 15: CORRECT TEXT Problem Scenario 14 : You have been given follo...
Question 16: CORRECT TEXT Problem Scenario 86 : In Continuation of previo...
Question 17: CORRECT TEXT Problem Scenario 51 : You have been given below...
Question 18: CORRECT TEXT Problem Scenario 19 : You have been given follo...
Question 19: CORRECT TEXT Problem Scenario 23 : You have been given log g...
Question 20: CORRECT TEXT Problem Scenario 42 : You have been given a fil...
Question 21: CORRECT TEXT Problem Scenario 29 : Please accomplish the fol...
Question 22: CORRECT TEXT Problem Scenario 22 : You have been given below...
Question 23: CORRECT TEXT Problem Scenario 24 : You have been given below...
Question 24: CORRECT TEXT Problem Scenario 82 : You have been given table...
Question 25: CORRECT TEXT Problem Scenario 89 : You have been given below...
Question 26: CORRECT TEXT Problem Scenario 11 : You have been given follo...
Question 27: CORRECT TEXT Problem Scenario 87 : You have been given below...
Question 28: CORRECT TEXT Problem Scenario 58 : You have been given below...
Question 29: CORRECT TEXT Problem Scenario 28 : You need to implement nea...
Question 30: CORRECT TEXT Problem Scenario 56 : You have been given below...
Question 31: CORRECT TEXT Problem Scenario 53 : You have been given below...
Question 32: CORRECT TEXT Problem Scenario 5 : You have been given follow...
Question 33: CORRECT TEXT Problem Scenario 16 : You have been given follo...
Question 34: CORRECT TEXT Problem Scenario 41 : You have been given below...
Question 35: CORRECT TEXT Problem Scenario 15 : You have been given follo...
Question 36: CORRECT TEXT Problem Scenario 30 : You have been given three...
Question 37: CORRECT TEXT Problem Scenario 43 : You have been given follo...
Question 38: CORRECT TEXT Problem Scenario 34 : You have given a file nam...
Question 39: CORRECT TEXT Problem Scenario 95 : You have to run your Spar...
Question 40: CORRECT TEXT Problem Scenario 83 : In Continuation of previo...
Question 41: CORRECT TEXT Problem Scenario 60 : You have been given below...
Question 42: CORRECT TEXT Problem Scenario 10 : You have been given follo...
Question 43: CORRECT TEXT Problem Scenario 65 : You have been given below...
Question 44: CORRECT TEXT Problem Scenario 21 : You have been given log g...
Question 45: CORRECT TEXT Problem Scenario 18 : You have been given follo...
Question 46: CORRECT TEXT Problem Scenario 3: You have been given MySQL D...
1 commentQuestion 47: CORRECT TEXT Problem Scenario 77 : You have been given MySQL...
Question 48: CORRECT TEXT Problem Scenario 40 : You have been given sampl...
Question 49: CORRECT TEXT Problem Scenario 85 : In Continuation of previo...
Question 50: CORRECT TEXT Problem Scenario 7 : You have been given follow...