开发者学堂课程【新电商大数据平台2020最新课程:电商项目之平台搜索热词统计 SQL 实现(上)】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/640/detail/10559
电商项目之平台搜索热词统计 SQL 实现(上)
平台搜索热词统计【ADS】
create external table if not exists ads_ nshop. ads_nshop_search_keys(
search_ keys string comment ‘搜索内容’ ,
gender string comment ‘性别’,
age_ range string comment ‘年龄段’,
os string comment '手机系统' ,
manufacturer string comment ‘手机制造商’,
area_ code string comment ‘地区编码’,
search users int coment ‘此搜索内容用户数’,
search_ records int comment ‘此搜索内容查询次数’,
search_orders string comment ‘查询排序’,
search _targets int coment ‘查询目标数量’
) partitioned by (bdp_ day string)
stored as parquet
location . /dat a/nshop/ ads/operation/ads_ nshop_ search_keys/’
代码如下:
with tborder as(
select
s1.target_ keys,
c.customer_id,
c.customer_gender,
c.custoemr_age_range,
s1.os,
s1.manufacturer,
s1.area_ code。
s1.target_ order,
s1.target_ id,
s2.search_ count
from
ods_ nshop.ods_02_customer C
join
dwd_ nshop.dwd_ nshop_ actlog_ pdtsearch s1
on
c.customer_ id=s1.user_id
join
dws_ nshop.dws_ nshop_ulog_search s2
on
s1.user_ ides2.user_ id
where
s1.bdp. day=‘20200321’
)
上一部分如上