只要是insert into 的就是没分区

 需求一:用户活跃主题

DWS层--(用户行为宽表层)

目标:统计当日、当周、当月活动的每个设备明细

1 每日活跃设备明细 dwd_start_log--->dws_uv_detail_day

--把相同的字段collect_set到一个数组, 按mid_id分组(便于后边统计)

 collect_set将某字段的值进行去重汇总,产生array类型字段。如: concat_ws('|', collect_set(user_id)) user_id,

建分区表dws_uv_detail_day partitioned by ('dt' string)

数仓1.3 |行为数据| 业务数据需求
drop table if exists dws_uv_detail_day;
create table dws_uv_detail_day( 
    `mid_id` string COMMENT '设备唯一标识',
    `user_id` string COMMENT '用户标识', 
    `version_code` string COMMENT '程序版本号', 
    `version_name` string COMMENT '程序版本名', 
`lang` string COMMENT '系统语言', 
`source` string COMMENT '渠道号', 
`os` string COMMENT '安卓系统版本', 
`area` string COMMENT '区域', 
`model` string COMMENT '手机型号', 
`brand` string COMMENT '手机品牌', 
`sdk_version` string COMMENT 'sdkVersion', 
`gmail` string COMMENT 'gmail', 
`height_width` string COMMENT '屏幕宽高',
`app_time` string COMMENT '客户端日志产生时的时间',
`network` string COMMENT '网络模式',
`lng` string COMMENT '经度',
`lat` string COMMENT '纬度'
) COMMENT '活跃用户按天明细'
PARTITIONED BY ( `dt` string)
stored as  parquet
location '/warehouse/gmall/dws/dws_uv_detail_day/'
;
View Code

相关文章:

  • 2021-12-11
  • 2021-06-02
  • 2021-04-21
  • 2021-12-14
  • 2021-09-16
  • 2021-10-01
  • 2021-06-03
  • 2022-12-23
猜你喜欢
  • 2022-01-13
  • 2022-12-23
  • 2021-04-14
  • 2021-08-25
  • 2021-08-09
  • 2021-10-16
  • 2021-10-04
相关资源
相似解决方案