Professional Documents
Culture Documents
Aggregation
Aggregation
=================================================
QUESTION 2:
========================================================
create table prod_profit_agr_wrk
(
product_id string,
count bigint
)
PARTITIONED BY
(
rptg_Dt STRING
)
STORED AS ORC;
INSERT OVERWRITE TABLE prod_profit_agr_wrk
PARTITION (rptg_dt)
SELECT u.product_id,
count(*),
u.rptg_dt
FROM user_activity_core u
LEFT OUTER JOIN products_info_core p
ON u.product_id=p.product_id
where u.cancellation='false' and u.return='False'
group by
u.product_id,u.rptg_dt;
===================================================================================
=
QUESTION 4
===========================================================================
===================================================================================
=
QUESTION 5
===========================================================================
fraud_detection
=========================================================================
QUESTION 6/7
=========================================================================
create table return_cancel_work
(
location struct<city:string,state:string>,
count bigint
)
PARTITIONED BY
(
rptg_dt string
)
STORED AS ORC;
===================================================================================
=============================
QUESTION - Final Hive table to generate most purchased category which fraud
detectation is return value is true
===================================================================================
=============================
===================================================================================
======================================
Sqoop final hive table data to MySQL using multiexport
===================================================================================
======================================
else use the hadoop directory directly with normal export command as below -
use /"*" for recursive export of partitions