沉默用户数:只在安装当天启动过,且启动时间在一周(或月)前。
- DWS层使用日活明细表作为数据
-
ADS层沉默设备数表。
hive (gmall)> drop table if exists ads_slient_count; create external table ads_slient_count( `dt` string COMMENT '统计日期', `slient_count` bigint COMMENT '沉默设备数' ) row format delimited fields terminated by '\t' location '/warehouse/gmall/ads/ads_slient_count';
-
导入数据
insert into table ads_slient_count select '2020-02-03', count(*) from ( select mid_id from dws_uv_detail_day where dt<='2020-02-03' group by mid_id having count(*)=1 and min(dt)<=date_add('2020-02-03',-7) )t1;
-
查询
hive (gmall)> select * from ads_slient_count;
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。