需求:统计各个城市所属区域下最受欢迎的Top 3产品
数据准备:
mysql:
city_info : 城市信息表
product_info: 产品信息表
hive:
user_click:用户行为点击日志表
create table user_click(
user_id int,
session_id string,
action_time string,
city_id int,
product_id int
) partitioned by (day string)
row format delimited fields terminated by ',';
一、在hive中创建city_info,product_info
create table city_info(
city_id int,
city_name string,
area string
)row format delimited fields terminated by '\t';
create table product_info(
product_id int,
product_name string,
extend_info string
)row format d