助力工业物联网,工业大数据之服务域:油站主题分析【二十六】(2)

img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化资料的朋友,可以戳这里获取

				    id,--油站id
				    company_name,--公司名称
				    province_name,--省份名称
				    city_name,--城市名称
				    county_name,--区域名称
				    customer_classify_name,--客户名称
				    customer_province_name--客户省份
				from dim_oilstation;
				
				```
				- dim\_date:时间维度表
				
				 
				```
				select
				    date_id,--天
				    week_in_year_id,--周
				    year_month_id --月
				from dim_date;
				
				```
  • 实现分析
select

       a.os_id,--油站id

       sum(a.os_num),--油站数量

       sum(a.current_new_os_num),--新增油站数量

       b.date_id,--天

       b.week_in_year_id,--周

       b.year_month_id, --月

       c.company_name,--公司名称

       c.province_name,--省份名称

       c.city_name,--城市名称

       c.county_name,--区域名称

       c.customer_classify_name,--客户名称

       c.customer_province_name--客户省份

   from fact_oil_station a

   join one_make_dws.dim_date b on a.dt = b.date_id

   join one_make_dws.dim_oilstation c on a.os_id = c.id

   group by

       b.date_id,--天

       b.week_in_year_id,--周

       b.year_month_id, --月

       c.company_name,--公司名称

       c.province_name,--省份名称

       c.city_name,--城市名称

       c.county_name,--区域名称

       c.customer_classify_name,--客户名称

       c.customer_province_name;--客户省份;

  • 小结

    • 掌握油站主题的需求分析

08:服务域:油站主题实现

  • 目标实现油站主题表的维度指标构建

  • 实施

    • 建表
    -- 创建油站主题表
    drop table if exists one_make_st.subj_oilstation;
    create table if not exists one_make_st.subj_oilstation(
        sum_osnum bigint comment '油站数量'
        ,sumnew_osnum int 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\_oilstation';
    
    
    • 构建
    insert overwrite table one_make_st.subj_oilstation partition(month = '202101', week='2021W1', day='20210101')
    select
        sum(oil.os_num) sum_osnum,                          --油站数量
    	sum(oil.current_new_os_num) sumnew_osnum,           --新增油站数量
        dd.date_id dws_day,                                 --日期天
    	dd.week_in_year_id dws_week,                        --日期周
    	dd.year_month_id dws_month,                         --日期月
        dimoil.company_name oil_type,                       --油站类型
    	dimoil.province_name oil_province,                  --油站省份
    	dimoil.city_name oil_city,                          --油站城市
        dimoil.county_name oil_county,                      --油站区域
    	dimoil.customer_classify_name customer_classify,    --客户类型
        dimoil.customer_province_name customer_province     --客户省份
    
    
    

img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

需要这份系统化资料的朋友,可以戳这里获取

多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**

需要这份系统化资料的朋友,可以戳这里获取

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值