,sum_repair_num int comment '维修数量'
,max_repair_num int comment '维修最大数量'
,min_repair_num int comment '维修最小数量'
,avg_repair_num decimal(20, 1) comment '维修平均数量'
,sum_wo_num int comment '派工数量'
,max_sum_wo_num int comment '派工最大数量'
,min_sum_wo_num int comment '派工最小数量'
,avg_sum_wo_num decimal(20, 1) comment '派工平均数量'
,sum_remould_num int comment '巡检数量'
,max_remould_num int comment '巡检最大数量'
,min_remould_num int comment '巡检最小数量'
,avg_remould_num decimal(20, 1) comment '巡检平均数量'
,sum_alread_complete_num int comment '回访数量'
,max_alread_complete_num int comment '回访最大数量'
,min_alread_complete_num int comment '回访最小数量'
,avg_alread_complete_num decimal(20, 1) comment '回访平均数量'
,dws_day string comment '日期维度-按天'
,dws_week string comment '日期维度-按周'
,dws_month string comment '日期维度-按月'
,oil_type string comment '油站维度-油站类型'
,oil_province string comment '油站维度-油站所属省'
,oil_city string comment '油站维度-油站所属市'
,oil_county string comment '油站维度-油站所属区'
,customer_classify string comment '客户维度-客户类型'
,customer_province string comment '客户维度-客户所属省'
) comment '客户主题表'
partitioned by (month String, week String, day String)
stored as orc
location '/data/dw/st/one\_make/subj\_customer'
;
```
insert overwrite table one_make_st.subj_customer partition(month = '202101', week='2021W1', day='20210101')
select
sum(fwo.install_num) sum_install_num, --安装数量
max(fwo.install_num) max_install_num, --最大安装数量
min(fwo.install_num) min_install_num, --最小安装数量
avg(fwo.install_num) avg_min_install_num, --平均安装数量
sum(fwo.repair_num) sum_repair_num,