Question: --Q1.2 Simplified to remove expression in sum select sum(lo_extendedprice) as revenue from lineorder, dwdate where lo_orderdate = d_datekey and d_yearmonth = 'Jan1993' and lo_discount between

--Q1.2 Simplified to remove expression in sum select sum(lo_extendedprice) as revenue from lineorder, dwdate where lo_orderdate = d_datekey and d_yearmonth = 'Jan1993' and lo_discount between 5 and 6 and lo_quantity between 25 and 35; --Q1.3 Simplified to remove expression in sum select sum(lo_extendedprice) as revenue from lineorder, dwdate where lo_orderdate = d_datekey and d_weeknuminyear = 6 and d_year = 1994 and lo_discount between 5 and 8 and lo_quantity between 36 and 41; --Q2.1 No simpifications select sum(lo_revenue), d_year, p_brand1 from lineorder, dwdate, part, supplier where lo_orderdate = d_datekey and lo_partkey = p_partkey and lo_suppkey = s_suppkey and p_category = 'MFGR#12' and s_region = 'AMERICA' group by d_year, p_brand1 order by d_year, p_brand1;

Run the above three (1.2, 1.3 and 2.1) queries in Hive and record the time they take to execute.Perform the following transform operation on the customer.tbl by creating a new table: For the c_address column, shorten it to 10 characters (i.e., if the value is longer, remove extra characters, but otherwise keep it as-is). For c_city, add a space to separate string and the digit at the end (e.g., UNITED KI2 => UNITED KI 2, or INDONESIA4 => INDONESIA 4) if necessary. Do not change c_city columns where space is already present (e.g., BRAZIL 2 does not need to change). Make sure to modify the columns of the target table accordingly.

customer.tbl : http://rasinsrv07.cstcis.cti.depaul.edu/CSC555/SSBM1/customer.tbl

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!