开发者学堂课程【新电商大数据平台2020最新课程:电商项目之流量类指标平台统计 PUV 表 SQL 实现】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/640/detail/10558
电商项目之流量类指标平台统计 PUV 表 SQL 实现
流量类指标平台流量统计 P/UV【ADS】
create external table if not exists ads_ nshop. ads_ nshop_ flowpu_ stat(
uv bigint comment ‘独立访客数’,
pv bigint comment ‘页面访客数’
pv_avg int comment‘人均员而访问数'
) partitioned by (bdp_day string)
stored as parquet
location '/data/nshop/ ads/operation/ads_nshop_flou/'
insert overwrite table ads. nshop.ads_nshop_flowpu_stat partition(bdp_day=’ 20200321')
select
count(distinct user_ id) as uv,
sum(view_ count)as pv,
sum(view_ count)/count(distinct user_id)as pa_avg
from
dws_ nshop.dws_ nshop_ ulog_view
where
bdp_ day=' 20200321’