开发者学堂课程【新电商大数据平台2020最新课程:电商项目之商家日流水宽表分析】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/640/detail/10550
电商项目之商家日流水宽表分析
内容介绍:
一、商家日流水宽表【DWS】
交易订单明细流水表【DWD】
一、商家日流水宽表【DWS】
create external table if not exists dws_ nshop. dws_nshop_ supplier_ sales(
supplier_ id string comment ‘商家1d’,
supplier_ type int comment ‘供应商类型: 1.自营,2.官方3其他’,
sales_ users int comment ‘购物人数’,
sales users_ area int comment ‘购构地区数量’,
sales_ orders int comment ‘购物订单数’ ,
salaes_ orders_pay DECIMAL(10,1) comment ‘订单金额’,
salaes_ orders_district DECIMAL(10,1) comment '订单优惠金额' ,
ct bigint comment '产生时间'
) partitioned by (bdp_day string)
stored as parquet
location'/data/nshop/dws/supplier/dws_nshop_supplier_ sales/'
订单金额:订单数量 X 商品 X 个数
订单优惠金额:优惠金额
create external table if not exists dws_ nshop. dws_nshop_ supplier_ sales_7d(
supplier_ id string comment ‘商家1d’,
supplier_ type int comment ‘供应商类型: 1.自营,2.官方3其他’,
sales_ users int comment ‘购物人数’,
sales users_ area int comment ‘购构地区数量’,
sales_ orders int comment ‘购物订单数’ ,
salaes_ orders_pay DECIMAL(10,1) comment ‘订单金额’,
salaes_ orders_district DECIMAL(10,1) comment '订单优惠金额' ,
ct bigint comment '产生时间'
) partitioned by (bdp_week string)
stored as parquet
location'/data/nshop/dws/supplier/dws_nshop_supplier_ sales_7d/'
购买人数:customer_id string comment ‘用户id’
商品销售价格:product_price DECIMAL COMMENT
二、交易订单明细流水表【DWD】
(ods_nshop.ods_nshop_02_orders,ods_nshop.ods_nshop_02 _order_detail,dim_nshop.dim_pub_product,ods_nshop.ods_nshop_02_orders_pay_records)
createexternaltableifnotexists dwd_nshop.dwd_nshop_orders_details(
order_ id string comnent '订单 ID' ,
order_status int comment '订单状态: 5已收货(完成)|6投诉 7退货’,
supplier_ code VARCHAR(20) COMMENT ‘店铺 ID',
product_ code VARCHAR(20) COMMENT ‘商品 ID',
customer_ id string comment ‘用户id',
consignee_ zipcode string comment ‘收货人地址‘ ,
pay_ type string comment ‘支付类型: 线上支付10网上银行11微信12支付宝 | 线下支付(货到付款)20’,
pay_ nettype varchar(1) COPENT ‘支付网络方式:0wifi | 1 4g | 2 3g | 3线下支付’,
pay_ count int comment ‘支付次数',
product_ price DECIMAL(5,1) COMMENT ‘购买商品单价’,
product_cnt INT COMMENT '购买商品数量’ ,
weighing_ cost DECIMAL(2,1) COPPENT '商品加权价格',
district_money DECIMAL(4,1) COPMHENT ‘优惠金额' ,
shipping_money DECIMAL(8,1) COPMHENT '运费金额’,
payment_money DECIMAL(10,1) COMIENT '支付金额' ,
is_ gactivity int COMMENT "1:参加活动|0: 没有参加活动",
order_ ctine bigint comment '创建时间’
) partitioned by (bdp. day string)
stored as parquet
location'/data/nshop/dwd/order/dwd_nshop_orders _details/'